<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE NamedFieldPuns #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE OverloadedStrings #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Tc.Gen.Export</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Gen.Export.html#rnExports"><span class="hs-identifier">rnExports</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Export.html#exports_from_avail"><span class="hs-identifier">exports_from_avail</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html"><span class="hs-identifier">GHC.Types.Name.Reader</span></a></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Names.html"><span class="hs-identifier">GHC.Rename.Names</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html"><span class="hs-identifier">GHC.Rename.Env</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html"><span class="hs-identifier">GHC.Rename.Unbound</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#reportUnboundName"><span class="hs-identifier">reportUnboundName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html"><span class="hs-identifier">GHC.Types.Id.Info</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html"><span class="hs-identifier">GHC.Types.Name.Set</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Avail.html"><span class="hs-identifier">GHC.Types.Avail</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">SrcLoc</span></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.ConLike.html"><span class="hs-identifier">GHC.Core.ConLike</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html"><span class="hs-identifier">GHC.Core.PatSyn</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html"><span class="hs-identifier">GHC.Types.Unique.Set</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Misc.html#capitalise"><span class="hs-identifier">capitalise</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier">fsLit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Doc.html"><span class="hs-identifier">GHC.Rename.Doc</span></a></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Rename.Doc.html#rnHsDoc"><span class="hs-identifier">rnHsDoc</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Parser.PostProcess.html"><span class="hs-identifier">GHC.Parser.PostProcess</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Parser.PostProcess.html#setRdrNameSpace"><span class="hs-identifier">setRdrNameSpace</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#"><span class="hs-identifier">Data.Either</span></a></span><span>            </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#partitionEithers"><span class="hs-identifier">partitionEithers</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Export list processing}
*                                                                      *
************************************************************************

Processing the export list.

You might think that we should record things that appear in the export
list as ``occurrences'' (using @addOccurrenceName@), but you'd be
wrong.  We do check (here) that they are in scope, but there is no
need to slurp in their actual declaration (which is what
@addOccurrenceName@ forces).

Indeed, doing so would big trouble when compiling @PrelBase@, because
it re-exports @GHC@, which includes @takeMVar#@, whose type includes
@ConcBase.StateAndSynchVar#@, and so on...

Note [Exports of data families]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppose you see (#5306)
        module M where
          import X( F )
          data instance F Int = FInt
What does M export?  AvailTC F [FInt]
                  or AvailTC F [F,FInt]?
The former is strictly right because F isn't defined in this module.
But then you can never do an explicit import of M, thus
    import M( F( FInt ) )
because F isn't exported by M.  Nor can you import FInt alone from here
    import M( FInt )
because we don't have syntax to support that.  (It looks like an import of
the type FInt.)

At one point I implemented a compromise:
  * When constructing exports with no export list, or with module M(
    module M ), we add the parent to the exports as well.
  * But not when you see module M( f ), even if f is a
    class method with a parent.
  * Nor when you see module M( module N ), with N /= M.

But the compromise seemed too much of a hack, so we backed it out.
You just have to use an explicit export list:
    module M( F(..) ) where ...

Note [Avails of associated data families]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppose you have (#16077)

    {-# LANGUAGE TypeFamilies #-}
    module A (module A) where

    class    C a  where { data T a }
    instance C () where { data T () = D }

Because @A@ is exported explicitly, GHC tries to produce an export list
from the @GlobalRdrEnv@. In this case, it pulls out the following:

    [ C defined at A.hs:4:1
    , T parent:C defined at A.hs:4:23
    , D parent:T defined at A.hs:5:35 ]

If map these directly into avails, (via 'availFromGRE'), we get
@[C{C;}, C{T;}, T{D;}]@, which eventually gets merged into @[C{C, T;}, T{D;}]@.
That's not right, because @T{D;}@ violates the AvailTC invariant: @T@ is
exported, but it isn't the first entry in the avail!

We work around this issue by expanding GREs where the parent and child
are both type constructors into two GRES.

    T parent:C defined at A.hs:4:23

      =&gt;

    [ T parent:C defined at A.hs:4:23
    , T defined at A.hs:4:23 ]

Then, we get  @[C{C;}, C{T;}, T{T;}, T{D;}]@, which eventually gets merged
into @[C{C, T;}, T{T, D;}]@ (which satsifies the AvailTC invariant).
-}</span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span class="hs-keyword">data</span><span> </span><span id="ExportAccum"><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-var">ExportAccum</span></a></span></span><span>        </span><span class="hs-comment">-- The type of the accumulating parameter of</span><span>
</span><span id="line-130"></span><span>                        </span><span class="hs-comment">-- the main worker function in rnExports</span><span>
</span><span id="line-131"></span><span>     </span><span class="hs-glyph">=</span><span> </span><span id="ExportAccum"><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-var">ExportAccum</span></a></span></span><span>
</span><span id="line-132"></span><span>        </span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportOccMap"><span class="hs-identifier hs-type">ExportOccMap</span></a></span><span>           </span><span class="hs-comment">--  Tracks exported occurrence names</span><span>
</span><span id="line-133"></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.Set.html#UniqSet"><span class="hs-identifier hs-type">UniqSet</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">)</span><span>   </span><span class="hs-comment">--  Tracks (re-)exported module names</span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#emptyExportAccum"><span class="hs-identifier hs-type">emptyExportAccum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-type">ExportAccum</span></a></span><span>
</span><span id="line-136"></span><span id="emptyExportAccum"><span class="annot"><span class="annottext">emptyExportAccum :: ExportAccum
</span><a href="GHC.Tc.Gen.Export.html#emptyExportAccum"><span class="hs-identifier hs-var hs-var">emptyExportAccum</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ExportOccMap -&gt; UniqSet ModuleName -&gt; ExportAccum
</span><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-var">ExportAccum</span></a></span><span> </span><span class="annot"><span class="annottext">ExportOccMap
forall a. OccEnv a
</span><a href="GHC.Types.Name.Occurrence.html#emptyOccEnv"><span class="hs-identifier hs-var">emptyOccEnv</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet ModuleName
forall a. UniqSet a
</span><a href="GHC.Types.Unique.Set.html#emptyUniqSet"><span class="hs-identifier hs-var">emptyUniqSet</span></a></span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span id="local-6989586621681162524"><span id="local-6989586621681162525"><span class="annot"><a href="GHC.Tc.Gen.Export.html#accumExports"><span class="hs-identifier hs-type">accumExports</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-type">ExportAccum</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681162525"><span class="hs-identifier hs-type">x</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRn"><span class="hs-identifier hs-type">TcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-type">ExportAccum</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681162524"><span class="hs-identifier hs-type">y</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681162525"><span class="hs-identifier hs-type">x</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-140"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRn"><span class="hs-identifier hs-type">TcRn</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681162524"><span class="hs-identifier hs-type">y</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-141"></span><span id="accumExports"><span class="annot"><span class="annottext">accumExports :: forall x y.
(ExportAccum -&gt; x -&gt; TcRn (Maybe (ExportAccum, y)))
-&gt; [x] -&gt; TcRn [y]
</span><a href="GHC.Tc.Gen.Export.html#accumExports"><span class="hs-identifier hs-var hs-var">accumExports</span></a></span></span><span> </span><span id="local-6989586621681162174"><span class="annot"><span class="annottext">ExportAccum -&gt; x -&gt; TcRn (Maybe (ExportAccum, y))
</span><a href="#local-6989586621681162174"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((ExportAccum, [Maybe y]) -&gt; [y])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ExportAccum, [Maybe y])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [y]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Maybe y] -&gt; [y]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">([Maybe y] -&gt; [y])
-&gt; ((ExportAccum, [Maybe y]) -&gt; [Maybe y])
-&gt; (ExportAccum, [Maybe y])
-&gt; [y]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(ExportAccum, [Maybe y]) -&gt; [Maybe y]
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) (ExportAccum, [Maybe y])
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) [y])
-&gt; ([x] -&gt; IOEnv (Env TcGblEnv TcLclEnv) (ExportAccum, [Maybe y]))
-&gt; [x]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [y]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(ExportAccum
 -&gt; x -&gt; IOEnv (Env TcGblEnv TcLclEnv) (ExportAccum, Maybe y))
-&gt; ExportAccum
-&gt; [x]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ExportAccum, [Maybe y])
forall (m :: * -&gt; *) acc x y.
Monad m =&gt;
(acc -&gt; x -&gt; m (acc, y)) -&gt; acc -&gt; [x] -&gt; m (acc, [y])
</span><a href="GHC.Utils.Monad.html#mapAccumLM"><span class="hs-identifier hs-var">mapAccumLM</span></a></span><span> </span><span class="annot"><span class="annottext">ExportAccum
-&gt; x -&gt; IOEnv (Env TcGblEnv TcLclEnv) (ExportAccum, Maybe y)
</span><a href="#local-6989586621681162170"><span class="hs-identifier hs-var">f'</span></a></span><span> </span><span class="annot"><span class="annottext">ExportAccum
</span><a href="GHC.Tc.Gen.Export.html#emptyExportAccum"><span class="hs-identifier hs-var">emptyExportAccum</span></a></span><span>
</span><span id="line-142"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681162170"><span class="annot"><span class="annottext">f' :: ExportAccum
-&gt; x -&gt; IOEnv (Env TcGblEnv TcLclEnv) (ExportAccum, Maybe y)
</span><a href="#local-6989586621681162170"><span class="hs-identifier hs-var hs-var">f'</span></a></span></span><span> </span><span id="local-6989586621681162169"><span class="annot"><span class="annottext">ExportAccum
</span><a href="#local-6989586621681162169"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621681162168"><span class="annot"><span class="annottext">x
</span><a href="#local-6989586621681162168"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-143"></span><span>          </span><span id="local-6989586621681162167"><span class="annot"><span class="annottext">Maybe (Maybe (ExportAccum, y))
</span><a href="#local-6989586621681162167"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn (Maybe (ExportAccum, y))
-&gt; TcRn (Maybe (Maybe (ExportAccum, y)))
forall r. TcRn r -&gt; TcRn (Maybe r)
</span><a href="GHC.Tc.Utils.Monad.html#attemptM"><span class="hs-identifier hs-var">attemptM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExportAccum -&gt; x -&gt; TcRn (Maybe (ExportAccum, y))
</span><a href="#local-6989586621681162174"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ExportAccum
</span><a href="#local-6989586621681162169"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">x
</span><a href="#local-6989586621681162168"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-144"></span><span>          </span><span class="annot"><span class="annottext">(ExportAccum, Maybe y)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ExportAccum, Maybe y)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">((ExportAccum, Maybe y)
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (ExportAccum, Maybe y))
-&gt; (ExportAccum, Maybe y)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ExportAccum, Maybe y)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (Maybe (ExportAccum, y))
</span><a href="#local-6989586621681162167"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-145"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681162165"><span class="annot"><span class="annottext">ExportAccum
</span><a href="#local-6989586621681162165"><span class="hs-identifier hs-var">acc'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681162164"><span class="annot"><span class="annottext">y
</span><a href="#local-6989586621681162164"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExportAccum
</span><a href="#local-6989586621681162165"><span class="hs-identifier hs-var">acc'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">y -&gt; Maybe y
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">y
</span><a href="#local-6989586621681162164"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>            </span><span class="annot"><span class="annottext">Maybe (Maybe (ExportAccum, y))
</span><span class="hs-identifier">_</span></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExportAccum
</span><a href="#local-6989586621681162169"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe y
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="hs-keyword">type</span><span> </span><span id="ExportOccMap"><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportOccMap"><span class="hs-identifier hs-var">ExportOccMap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccEnv"><span class="hs-identifier hs-type">OccEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span>        </span><span class="hs-comment">-- Tracks what a particular exported OccName</span><span>
</span><span id="line-150"></span><span>        </span><span class="hs-comment">--   in an export list refers to, and which item</span><span>
</span><span id="line-151"></span><span>        </span><span class="hs-comment">--   it came from.  It's illegal to export two distinct things</span><span>
</span><span id="line-152"></span><span>        </span><span class="hs-comment">--   that have the same occurrence name</span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#rnExports"><span class="hs-identifier hs-type">rnExports</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>       </span><span class="hs-comment">-- False =&gt; no 'module M(..) where' header at all</span><span>
</span><span id="line-155"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIE"><span class="hs-identifier hs-type">LIE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Nothing =&gt; no explicit export list</span><span>
</span><span id="line-156"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span>        </span><span class="hs-comment">-- Complains if two distinct exports have same OccName</span><span>
</span><span id="line-159"></span><span>        </span><span class="hs-comment">-- Warns about identical exports.</span><span>
</span><span id="line-160"></span><span>        </span><span class="hs-comment">-- Complains about exports items not in scope</span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span id="rnExports"><span class="annot"><span class="annottext">rnExports :: Bool -&gt; Maybe (Located [LIE GhcPs]) -&gt; RnM TcGblEnv
</span><a href="GHC.Tc.Gen.Export.html#rnExports"><span class="hs-identifier hs-var hs-var">rnExports</span></a></span></span><span> </span><span id="local-6989586621681162163"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681162163"><span class="hs-identifier hs-var">explicit_mod</span></a></span></span><span> </span><span id="local-6989586621681162162"><span class="annot"><span class="annottext">Maybe (Located [LIE GhcPs])
</span><a href="#local-6989586621681162162"><span class="hs-identifier hs-var">exports</span></a></span></span><span>
</span><span id="line-163"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RnM TcGblEnv -&gt; RnM TcGblEnv
forall r. TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Monad.html#checkNoErrs"><span class="hs-identifier hs-var">checkNoErrs</span></a></span><span> </span><span class="annot"><span class="annottext">(RnM TcGblEnv -&gt; RnM TcGblEnv) -&gt; RnM TcGblEnv -&gt; RnM TcGblEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>   </span><span class="hs-comment">-- Fail if anything in rnExports finds</span><span>
</span><span id="line-164"></span><span>                   </span><span class="hs-comment">-- an error fails, to avoid error cascade</span><span>
</span><span id="line-165"></span><span>   </span><span class="annot"><span class="annottext">WarningFlag -&gt; RnM TcGblEnv -&gt; RnM TcGblEnv
forall gbl lcl a.
WarningFlag -&gt; TcRnIf gbl lcl a -&gt; TcRnIf gbl lcl a
</span><a href="GHC.Tc.Utils.Monad.html#unsetWOptM"><span class="hs-identifier hs-var">unsetWOptM</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnWarningsDeprecations"><span class="hs-identifier hs-var">Opt_WarnWarningsDeprecations</span></a></span><span> </span><span class="annot"><span class="annottext">(RnM TcGblEnv -&gt; RnM TcGblEnv) -&gt; RnM TcGblEnv -&gt; RnM TcGblEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-166"></span><span>       </span><span class="hs-comment">-- Do not report deprecations arising from the export</span><span>
</span><span id="line-167"></span><span>       </span><span class="hs-comment">-- list, to avoid bleating about re-exporting a deprecated</span><span>
</span><span id="line-168"></span><span>       </span><span class="hs-comment">-- thing (especially via 'module Foo' export item)</span><span>
</span><span id="line-169"></span><span>   </span><span class="hs-keyword">do</span><span>   </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681162158"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681162158"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-170"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681162156"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681162156"><span class="hs-identifier hs-var">tcg_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RnM TcGblEnv
forall gbl lcl. TcRnIf gbl lcl gbl
</span><a href="GHC.Tc.Utils.Monad.html#getGblEnv"><span class="hs-identifier hs-var">getGblEnv</span></a></span><span>
</span><span id="line-171"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcg_mod :: TcGblEnv -&gt; Module
</span><a href="GHC.Tc.Types.html#tcg_mod"><span class="hs-identifier hs-var">tcg_mod</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681162152"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681162152"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span>
</span><span id="line-172"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcg_rdr_env :: TcGblEnv -&gt; GlobalRdrEnv
</span><a href="GHC.Tc.Types.html#tcg_rdr_env"><span class="hs-identifier hs-var">tcg_rdr_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681162150"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681162150"><span class="hs-identifier hs-var">rdr_env</span></a></span></span><span>
</span><span id="line-173"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcg_imports :: TcGblEnv -&gt; ImportAvails
</span><a href="GHC.Tc.Types.html#tcg_imports"><span class="hs-identifier hs-var">tcg_imports</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681162148"><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681162148"><span class="hs-identifier hs-var">imports</span></a></span></span><span>
</span><span id="line-174"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcg_src :: TcGblEnv -&gt; HscSource
</span><a href="GHC.Tc.Types.html#tcg_src"><span class="hs-identifier hs-var">tcg_src</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681162146"><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681162146"><span class="hs-identifier hs-var">hsc_src</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681162156"><span class="hs-identifier hs-var">tcg_env</span></a></span><span>
</span><span id="line-175"></span><span>              </span><span id="local-6989586621681162145"><span class="annot"><span class="annottext">default_main :: RdrName
</span><a href="#local-6989586621681162145"><span class="hs-identifier hs-var hs-var">default_main</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Module
</span><a href="GHC.Driver.Session.html#mainModIs"><span class="hs-identifier hs-var hs-var">mainModIs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681162158"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; Module -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681162152"><span class="hs-identifier hs-var">this_mod</span></a></span><span>
</span><span id="line-176"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681162143"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681162143"><span class="hs-identifier hs-var">main_fun</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe String
</span><a href="GHC.Driver.Session.html#mainFunIs"><span class="hs-identifier hs-var hs-var">mainFunIs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681162158"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-177"></span><span>                           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; FastString -&gt; RdrName
</span><a href="GHC.Types.Name.Reader.html#mkUnqual"><span class="hs-identifier hs-var">mkUnqual</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#varName"><span class="hs-identifier hs-var">varName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681162143"><span class="hs-identifier hs-var">main_fun</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-178"></span><span>                           </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-179"></span><span>                           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="GHC.Builtin.Names.html#main_RDR_Unqual"><span class="hs-identifier hs-var">main_RDR_Unqual</span></a></span><span>
</span><span id="line-180"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681162138"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681162138"><span class="hs-identifier hs-var">has_main</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; ([Name] -&gt; Bool) -&gt; [Name] -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([Name] -&gt; Bool)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Name]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) Bool
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Name]
</span><a href="GHC.Rename.Env.html#lookupInfoOccRn"><span class="hs-identifier hs-var">lookupInfoOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681162145"><span class="hs-identifier hs-var">default_main</span></a></span><span> </span><span class="hs-comment">-- #17832</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span>        </span><span class="hs-comment">-- If a module has no explicit header, and it has one or more main</span><span>
</span><span id="line-183"></span><span>        </span><span class="hs-comment">-- functions in scope, then add a header like</span><span>
</span><span id="line-184"></span><span>        </span><span class="hs-comment">-- &quot;module Main(main) where ...&quot;                               #13839</span><span>
</span><span id="line-185"></span><span>        </span><span class="hs-comment">-- See Note [Modules without a module header]</span><span>
</span><span id="line-186"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681162133"><span class="annot"><span class="annottext">real_exports :: Maybe (Located [LIE GhcPs])
</span><a href="#local-6989586621681162133"><span class="hs-identifier hs-var hs-var">real_exports</span></a></span></span><span>
</span><span id="line-187"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681162163"><span class="hs-identifier hs-var">explicit_mod</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Located [LIE GhcPs])
</span><a href="#local-6989586621681162162"><span class="hs-identifier hs-var">exports</span></a></span><span>
</span><span id="line-188"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681162138"><span class="hs-identifier hs-var">has_main</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located [LIE GhcPs] -&gt; Maybe (Located [LIE GhcPs])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LIE GhcPs] -&gt; Located [LIE GhcPs]
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">IE GhcPs -&gt; LIE GhcPs
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XIEVar GhcPs -&gt; LIEWrappedName (IdP GhcPs) -&gt; IE GhcPs
forall pass. XIEVar pass -&gt; LIEWrappedName (IdP pass) -&gt; IE pass
</span><a href="GHC.Hs.ImpExp.html#IEVar"><span class="hs-identifier hs-var">IEVar</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XIEVar GhcPs
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-189"></span><span>                                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IEWrappedName RdrName -&gt; Located (IEWrappedName RdrName)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; IEWrappedName RdrName
forall name. Located name -&gt; IEWrappedName name
</span><a href="GHC.Hs.ImpExp.html#IEName"><span class="hs-identifier hs-var">IEName</span></a></span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; IEWrappedName RdrName)
-&gt; Located RdrName -&gt; IEWrappedName RdrName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; Located RdrName
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681162145"><span class="hs-identifier hs-var">default_main</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-190"></span><span>                              </span><span class="hs-comment">-- ToDo: the 'noLoc' here is unhelpful if 'main'</span><span>
</span><span id="line-191"></span><span>                              </span><span class="hs-comment">--       turns out to be out of scope</span><span>
</span><span id="line-192"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Located [LIE GhcPs])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span>        </span><span class="hs-comment">-- Rename the export list</span><span>
</span><span id="line-195"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681162128"><span class="annot"><span class="annottext">do_it :: RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
</span><a href="#local-6989586621681162128"><span class="hs-identifier hs-var hs-var">do_it</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Located [LIE GhcPs])
-&gt; GlobalRdrEnv
-&gt; ImportAvails
-&gt; Module
-&gt; RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
</span><a href="GHC.Tc.Gen.Export.html#exports_from_avail"><span class="hs-identifier hs-var">exports_from_avail</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Located [LIE GhcPs])
</span><a href="#local-6989586621681162133"><span class="hs-identifier hs-var">real_exports</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681162150"><span class="hs-identifier hs-var">rdr_env</span></a></span><span> </span><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681162148"><span class="hs-identifier hs-var">imports</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681162152"><span class="hs-identifier hs-var">this_mod</span></a></span><span>
</span><span id="line-196"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681162127"><span class="annot"><span class="annottext">Maybe [(LIE GhcRn, [AvailInfo])]
</span><a href="#local-6989586621681162127"><span class="hs-identifier hs-var">rn_exports</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681162126"><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681162126"><span class="hs-identifier hs-var">final_avails</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-197"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681162146"><span class="hs-identifier hs-var">hsc_src</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource -&gt; HscSource -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsigFile"><span class="hs-identifier hs-var">HsigFile</span></a></span><span>
</span><span id="line-198"></span><span>                </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681162124"><span class="annot"><span class="annottext">Maybe (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
</span><a href="#local-6989586621681162124"><span class="hs-identifier hs-var">mb_r</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681162123"><span class="annot"><span class="annottext">Messages
</span><a href="#local-6989586621681162123"><span class="hs-identifier hs-var">msgs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
-&gt; TcRn
     (Maybe (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo]), Messages)
forall a. TcRn a -&gt; TcRn (Maybe a, Messages)
</span><a href="GHC.Tc.Utils.Monad.html#tryTc"><span class="hs-identifier hs-var">tryTc</span></a></span><span> </span><span class="annot"><span class="annottext">RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
</span><a href="#local-6989586621681162128"><span class="hs-identifier hs-var">do_it</span></a></span><span>
</span><span id="line-199"></span><span>                        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
</span><a href="#local-6989586621681162124"><span class="hs-identifier hs-var">mb_r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-200"></span><span>                            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681162121"><span class="annot"><span class="annottext">(Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
</span><a href="#local-6989586621681162121"><span class="hs-identifier hs-var">r</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
-&gt; RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
</span><a href="#local-6989586621681162121"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-201"></span><span>                            </span><span class="annot"><span class="annottext">Maybe (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Messages -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addMessages"><span class="hs-identifier hs-var">addMessages</span></a></span><span> </span><span class="annot"><span class="annottext">Messages
</span><a href="#local-6989586621681162123"><span class="hs-identifier hs-var">msgs</span></a></span><span> </span><span class="annot"><span class="annottext">TcRn ()
-&gt; RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
-&gt; RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
forall env a. IOEnv env a
</span><a href="GHC.Data.IOEnv.html#failM"><span class="hs-identifier hs-var">failM</span></a></span><span>
</span><span id="line-202"></span><span>                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
-&gt; RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
forall r. TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Monad.html#checkNoErrs"><span class="hs-identifier hs-var">checkNoErrs</span></a></span><span> </span><span class="annot"><span class="annottext">RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
</span><a href="#local-6989586621681162128"><span class="hs-identifier hs-var">do_it</span></a></span><span>
</span><span id="line-203"></span><span>
</span><span id="line-204"></span><span>        </span><span class="hs-comment">-- Final processing</span><span>
</span><span id="line-205"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681162118"><span class="annot"><span class="annottext">final_ns :: NameSet
</span><a href="#local-6989586621681162118"><span class="hs-identifier hs-var hs-var">final_ns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[AvailInfo] -&gt; NameSet
</span><a href="GHC.Types.Avail.html#availsToNameSetWithSelectors"><span class="hs-identifier hs-var">availsToNameSetWithSelectors</span></a></span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681162126"><span class="hs-identifier hs-var">final_avails</span></a></span><span>
</span><span id="line-206"></span><span>
</span><span id="line-207"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnExports: Exports:&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[AvailInfo] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681162126"><span class="hs-identifier hs-var">final_avails</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TcGblEnv -&gt; RnM TcGblEnv
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681162156"><span class="hs-identifier hs-var">tcg_env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcg_exports :: [AvailInfo]
</span><a href="GHC.Tc.Types.html#tcg_exports"><span class="hs-identifier hs-var">tcg_exports</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681162126"><span class="hs-identifier hs-var">final_avails</span></a></span><span>
</span><span id="line-210"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcg_rn_exports :: Maybe [(LIE GhcRn, [AvailInfo])]
</span><a href="GHC.Tc.Types.html#tcg_rn_exports"><span class="hs-identifier hs-var">tcg_rn_exports</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TcGblEnv -&gt; Maybe [(LIE GhcRn, [AvailInfo])]
</span><a href="GHC.Tc.Types.html#tcg_rn_exports"><span class="hs-identifier hs-var hs-var">tcg_rn_exports</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681162156"><span class="hs-identifier hs-var">tcg_env</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-211"></span><span>                                                </span><span class="annot"><span class="annottext">Maybe [(LIE GhcRn, [AvailInfo])]
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe [(LIE GhcRn, [AvailInfo])]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-212"></span><span>                                                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[(LIE GhcRn, [AvailInfo])]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe [(LIE GhcRn, [AvailInfo])]
</span><a href="#local-6989586621681162127"><span class="hs-identifier hs-var">rn_exports</span></a></span><span>
</span><span id="line-213"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcg_dus :: DefUses
</span><a href="GHC.Tc.Types.html#tcg_dus"><span class="hs-identifier hs-var">tcg_dus</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcGblEnv -&gt; DefUses
</span><a href="GHC.Tc.Types.html#tcg_dus"><span class="hs-identifier hs-var hs-var">tcg_dus</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681162156"><span class="hs-identifier hs-var">tcg_env</span></a></span><span> </span><span class="annot"><span class="annottext">DefUses -&gt; DefUses -&gt; DefUses
</span><a href="GHC.Types.Name.Set.html#plusDU"><span class="hs-operator hs-var">`plusDU`</span></a></span><span>
</span><span id="line-214"></span><span>                                      </span><span class="annot"><span class="annottext">NameSet -&gt; DefUses
</span><a href="GHC.Types.Name.Set.html#usesOnly"><span class="hs-identifier hs-var">usesOnly</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681162118"><span class="hs-identifier hs-var">final_ns</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-215"></span><span>
</span><span id="line-216"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#exports_from_avail"><span class="hs-identifier hs-type">exports_from_avail</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIE"><span class="hs-identifier hs-type">LIE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-217"></span><span>                         </span><span class="hs-comment">-- ^ 'Nothing' means no explicit export list</span><span>
</span><span id="line-218"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span>
</span><span id="line-219"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#ImportAvails"><span class="hs-identifier hs-type">ImportAvails</span></a></span><span>
</span><span id="line-220"></span><span>                         </span><span class="hs-comment">-- ^ Imported modules; this is used to test if a</span><span>
</span><span id="line-221"></span><span>                         </span><span class="hs-comment">-- @module Foo@ export is valid (it's not valid</span><span>
</span><span id="line-222"></span><span>                         </span><span class="hs-comment">-- if we didn't import @Foo@!)</span><span>
</span><span id="line-223"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-224"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIE"><span class="hs-identifier hs-type">LIE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Avail.html#Avails"><span class="hs-identifier hs-type">Avails</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Avail.html#Avails"><span class="hs-identifier hs-type">Avails</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-225"></span><span>                         </span><span class="hs-comment">-- (Nothing, _) &lt;=&gt; no explicit export list</span><span>
</span><span id="line-226"></span><span>                         </span><span class="hs-comment">-- if explicit export list is present it contains</span><span>
</span><span id="line-227"></span><span>                         </span><span class="hs-comment">-- each renamed export item together with its exported</span><span>
</span><span id="line-228"></span><span>                         </span><span class="hs-comment">-- names.</span><span>
</span><span id="line-229"></span><span>
</span><span id="line-230"></span><span id="exports_from_avail"><span class="annot"><span class="annottext">exports_from_avail :: Maybe (Located [LIE GhcPs])
-&gt; GlobalRdrEnv
-&gt; ImportAvails
-&gt; Module
-&gt; RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
</span><a href="GHC.Tc.Gen.Export.html#exports_from_avail"><span class="hs-identifier hs-var hs-var">exports_from_avail</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe (Located [LIE GhcPs])
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span id="local-6989586621681162108"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681162108"><span class="hs-identifier hs-var">rdr_env</span></a></span></span><span> </span><span id="local-6989586621681162107"><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681162107"><span class="hs-identifier hs-var">_imports</span></a></span></span><span> </span><span id="local-6989586621681162106"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681162106"><span class="hs-identifier hs-var">_this_mod</span></a></span></span><span>
</span><span id="line-231"></span><span>   </span><span class="hs-comment">-- The same as (module M) where M is the current module name,</span><span>
</span><span id="line-232"></span><span>   </span><span class="hs-comment">-- so that's how we handle it, except we also export the data family</span><span>
</span><span id="line-233"></span><span>   </span><span class="hs-comment">-- when a data instance is exported.</span><span>
</span><span id="line-234"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-235"></span><span>    </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681162105"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681162105"><span class="hs-identifier hs-var">warnMissingExportList</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; IOEnv (Env TcGblEnv TcLclEnv) Bool
forall gbl lcl. WarningFlag -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#woptM"><span class="hs-identifier hs-var">woptM</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnMissingExportList"><span class="hs-identifier hs-var">Opt_WarnMissingExportList</span></a></span><span>
</span><span id="line-236"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; Bool -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#warnIfFlag"><span class="hs-identifier hs-var">warnIfFlag</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnMissingExportList"><span class="hs-identifier hs-var">Opt_WarnMissingExportList</span></a></span><span>
</span><span id="line-237"></span><span>        </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681162105"><span class="hs-identifier hs-var">warnMissingExportList</span></a></span><span>
</span><span id="line-238"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#missingModuleExportWarn"><span class="hs-identifier hs-var">missingModuleExportWarn</span></a></span><span> </span><span class="annot"><span class="annottext">(ModuleName -&gt; SDoc) -&gt; ModuleName -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681162106"><span class="hs-identifier hs-var">_this_mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-239"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681162099"><span class="annot"><span class="annottext">avails :: [AvailInfo]
</span><a href="#local-6989586621681162099"><span class="hs-identifier hs-var hs-var">avails</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-240"></span><span>            </span><span class="annot"><span class="annottext">(AvailInfo -&gt; AvailInfo) -&gt; [AvailInfo] -&gt; [AvailInfo]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">AvailInfo -&gt; AvailInfo
</span><a href="#local-6989586621681162098"><span class="hs-identifier hs-var">fix_faminst</span></a></span><span> </span><span class="annot"><span class="annottext">([AvailInfo] -&gt; [AvailInfo])
-&gt; (GlobalRdrEnv -&gt; [AvailInfo]) -&gt; GlobalRdrEnv -&gt; [AvailInfo]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt] -&gt; [AvailInfo]
</span><a href="GHC.Types.Name.Reader.html#gresToAvailInfo"><span class="hs-identifier hs-var">gresToAvailInfo</span></a></span><span>
</span><span id="line-241"></span><span>              </span><span class="annot"><span class="annottext">([GlobalRdrElt] -&gt; [AvailInfo])
-&gt; (GlobalRdrEnv -&gt; [GlobalRdrElt]) -&gt; GlobalRdrEnv -&gt; [AvailInfo]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; Bool) -&gt; [GlobalRdrElt] -&gt; [GlobalRdrElt]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isLocalGRE"><span class="hs-identifier hs-var">isLocalGRE</span></a></span><span> </span><span class="annot"><span class="annottext">([GlobalRdrElt] -&gt; [GlobalRdrElt])
-&gt; (GlobalRdrEnv -&gt; [GlobalRdrElt])
-&gt; GlobalRdrEnv
-&gt; [GlobalRdrElt]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#globalRdrEnvElts"><span class="hs-identifier hs-var">globalRdrEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv -&gt; [AvailInfo]) -&gt; GlobalRdrEnv -&gt; [AvailInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681162108"><span class="hs-identifier hs-var">rdr_env</span></a></span><span>
</span><span id="line-242"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
-&gt; RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe [(LIE GhcRn, [AvailInfo])]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681162099"><span class="hs-identifier hs-var">avails</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-243"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-244"></span><span>    </span><span class="hs-comment">-- #11164: when we define a data instance</span><span>
</span><span id="line-245"></span><span>    </span><span class="hs-comment">-- but not data family, re-export the family</span><span>
</span><span id="line-246"></span><span>    </span><span class="hs-comment">-- Even though we don't check whether this is actually a data family</span><span>
</span><span id="line-247"></span><span>    </span><span class="hs-comment">-- only data families can locally define subordinate things (`ns` here)</span><span>
</span><span id="line-248"></span><span>    </span><span class="hs-comment">-- without locally defining (and instead importing) the parent (`n`)</span><span>
</span><span id="line-249"></span><span>    </span><span id="local-6989586621681162098"><span class="annot"><span class="annottext">fix_faminst :: AvailInfo -&gt; AvailInfo
</span><a href="#local-6989586621681162098"><span class="hs-identifier hs-var hs-var">fix_faminst</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Avail.html#AvailTC"><span class="hs-identifier hs-type">AvailTC</span></a></span><span> </span><span id="local-6989586621681162092"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681162092"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681162091"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681162091"><span class="hs-identifier hs-var">ns</span></a></span></span><span> </span><span id="local-6989586621681162090"><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681162090"><span class="hs-identifier hs-var">flds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-250"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681162089"><span class="annot"><span class="annottext">new_ns :: [Name]
</span><a href="#local-6989586621681162089"><span class="hs-identifier hs-var hs-var">new_ns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-251"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681162091"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-252"></span><span>              </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681162092"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-253"></span><span>              </span><span class="hs-special">(</span><span id="local-6989586621681162088"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681162088"><span class="hs-identifier hs-var">p</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[Name]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681162088"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681162092"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681162091"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681162092"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; [Name]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681162091"><span class="hs-identifier hs-var">ns</span></a></span><span>
</span><span id="line-254"></span><span>      </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; [FieldLabel] -&gt; AvailInfo
</span><a href="GHC.Types.Avail.html#AvailTC"><span class="hs-identifier hs-var">AvailTC</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681162092"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681162089"><span class="hs-identifier hs-var">new_ns</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681162090"><span class="hs-identifier hs-var">flds</span></a></span><span>
</span><span id="line-255"></span><span>
</span><span id="line-256"></span><span>    </span><span class="annot"><a href="#local-6989586621681162098"><span class="hs-identifier hs-var">fix_faminst</span></a></span><span> </span><span id="local-6989586621681162087"><span class="annot"><span class="annottext">AvailInfo
</span><a href="#local-6989586621681162087"><span class="hs-identifier hs-var">avail</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AvailInfo
</span><a href="#local-6989586621681162087"><span class="hs-identifier hs-var">avail</span></a></span><span>
</span><span id="line-257"></span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#exports_from_avail"><span class="hs-identifier hs-var">exports_from_avail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681162085"><span class="annot"><span class="annottext">[LIE GhcPs]
</span><a href="#local-6989586621681162085"><span class="hs-identifier hs-var">rdr_items</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681162084"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681162084"><span class="hs-identifier hs-var">rdr_env</span></a></span></span><span> </span><span id="local-6989586621681162083"><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681162083"><span class="hs-identifier hs-var">imports</span></a></span></span><span> </span><span id="local-6989586621681162082"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681162082"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span>
</span><span id="line-260"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681162081"><span class="annot"><span class="annottext">[(LIE GhcRn, [AvailInfo])]
</span><a href="#local-6989586621681162081"><span class="hs-identifier hs-var">ie_avails</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(ExportAccum
 -&gt; LIE GhcPs
 -&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo]))))
-&gt; [LIE GhcPs] -&gt; TcRn [(LIE GhcRn, [AvailInfo])]
forall x y.
(ExportAccum -&gt; x -&gt; TcRn (Maybe (ExportAccum, y)))
-&gt; [x] -&gt; TcRn [y]
</span><a href="GHC.Tc.Gen.Export.html#accumExports"><span class="hs-identifier hs-var">accumExports</span></a></span><span> </span><span class="annot"><span class="annottext">ExportAccum
-&gt; LIE GhcPs
-&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo])))
</span><a href="#local-6989586621681162080"><span class="hs-identifier hs-var">do_litem</span></a></span><span> </span><span class="annot"><span class="annottext">[LIE GhcPs]
</span><a href="#local-6989586621681162085"><span class="hs-identifier hs-var">rdr_items</span></a></span><span>
</span><span id="line-261"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681162079"><span class="annot"><span class="annottext">final_exports :: [AvailInfo]
</span><a href="#local-6989586621681162079"><span class="hs-identifier hs-var hs-var">final_exports</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[AvailInfo] -&gt; [AvailInfo]
</span><a href="GHC.Types.Avail.html#nubAvails"><span class="hs-identifier hs-var">nubAvails</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((LIE GhcRn, [AvailInfo]) -&gt; [AvailInfo])
-&gt; [(LIE GhcRn, [AvailInfo])] -&gt; [AvailInfo]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">(LIE GhcRn, [AvailInfo]) -&gt; [AvailInfo]
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">[(LIE GhcRn, [AvailInfo])]
</span><a href="#local-6989586621681162081"><span class="hs-identifier hs-var">ie_avails</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Combine families</span><span>
</span><span id="line-262"></span><span>       </span><span class="annot"><span class="annottext">(Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
-&gt; RnM (Maybe [(LIE GhcRn, [AvailInfo])], [AvailInfo])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(LIE GhcRn, [AvailInfo])] -&gt; Maybe [(LIE GhcRn, [AvailInfo])]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[(LIE GhcRn, [AvailInfo])]
</span><a href="#local-6989586621681162081"><span class="hs-identifier hs-var">ie_avails</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681162079"><span class="hs-identifier hs-var">final_exports</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-263"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-264"></span><span>    </span><span class="annot"><a href="#local-6989586621681162080"><span class="hs-identifier hs-type">do_litem</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-type">ExportAccum</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIE"><span class="hs-identifier hs-type">LIE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-265"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-type">ExportAccum</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIE"><span class="hs-identifier hs-type">LIE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Avail.html#Avails"><span class="hs-identifier hs-type">Avails</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-266"></span><span>    </span><span id="local-6989586621681162080"><span class="annot"><span class="annottext">do_litem :: ExportAccum
-&gt; LIE GhcPs
-&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo])))
</span><a href="#local-6989586621681162080"><span class="hs-identifier hs-var hs-var">do_litem</span></a></span></span><span> </span><span id="local-6989586621681162076"><span class="annot"><span class="annottext">ExportAccum
</span><a href="#local-6989586621681162076"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621681162075"><span class="annot"><span class="annottext">LIE GhcPs
</span><a href="#local-6989586621681162075"><span class="hs-identifier hs-var">lie</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo])))
-&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo])))
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LIE GhcPs -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LIE GhcPs
</span><a href="#local-6989586621681162075"><span class="hs-identifier hs-var">lie</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExportAccum
-&gt; LIE GhcPs
-&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo])))
</span><a href="#local-6989586621681162072"><span class="hs-identifier hs-var">exports_from_item</span></a></span><span> </span><span class="annot"><span class="annottext">ExportAccum
</span><a href="#local-6989586621681162076"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">LIE GhcPs
</span><a href="#local-6989586621681162075"><span class="hs-identifier hs-var">lie</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span>    </span><span class="hs-comment">-- Maps a parent to its in-scope children</span><span>
</span><span id="line-269"></span><span>    </span><span class="annot"><a href="#local-6989586621681162071"><span class="hs-identifier hs-type">kids_env</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-270"></span><span>    </span><span id="local-6989586621681162071"><span class="annot"><span class="annottext">kids_env :: NameEnv [GlobalRdrElt]
</span><a href="#local-6989586621681162071"><span class="hs-identifier hs-var hs-var">kids_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt] -&gt; NameEnv [GlobalRdrElt]
</span><a href="GHC.Rename.Names.html#mkChildEnv"><span class="hs-identifier hs-var">mkChildEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#globalRdrEnvElts"><span class="hs-identifier hs-var">globalRdrEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681162084"><span class="hs-identifier hs-var">rdr_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-271"></span><span>
</span><span id="line-272"></span><span>    </span><span class="hs-comment">-- See Note [Avails of associated data families]</span><span>
</span><span id="line-273"></span><span>    </span><span class="annot"><a href="#local-6989586621681162069"><span class="hs-identifier hs-type">expand_tyty_gre</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-274"></span><span>    </span><span id="local-6989586621681162069"><span class="annot"><span class="annottext">expand_tyty_gre :: GlobalRdrElt -&gt; [GlobalRdrElt]
</span><a href="#local-6989586621681162069"><span class="hs-identifier hs-var hs-var">expand_tyty_gre</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681162068"><span class="annot"><span class="annottext">gre :: GlobalRdrElt
</span><a href="#local-6989586621681162068"><span class="hs-identifier hs-var">gre</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GRE"><span class="hs-identifier hs-type">GRE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">gre_name :: GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var">gre_name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681162065"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681162065"><span class="hs-identifier hs-var">me</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">gre_par :: GlobalRdrElt -&gt; Parent
</span><a href="GHC.Types.Name.Reader.html#gre_par"><span class="hs-identifier hs-var">gre_par</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#ParentIs"><span class="hs-identifier hs-type">ParentIs</span></a></span><span> </span><span id="local-6989586621681162062"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681162062"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-275"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isTyConName"><span class="hs-identifier hs-var">isTyConName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681162062"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isTyConName"><span class="hs-identifier hs-var">isTyConName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681162065"><span class="hs-identifier hs-var">me</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162068"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162068"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">gre_par :: Parent
</span><a href="GHC.Types.Name.Reader.html#gre_par"><span class="hs-identifier hs-var">gre_par</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Parent
</span><a href="GHC.Types.Name.Reader.html#NoParent"><span class="hs-identifier hs-var">NoParent</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">]</span><span>
</span><span id="line-276"></span><span>    </span><span class="annot"><a href="#local-6989586621681162069"><span class="hs-identifier hs-var">expand_tyty_gre</span></a></span><span> </span><span id="local-6989586621681162059"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162059"><span class="hs-identifier hs-var">gre</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162059"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-277"></span><span>
</span><span id="line-278"></span><span>    </span><span id="local-6989586621681162058"><span class="annot"><span class="annottext">imported_modules :: [ModuleName]
</span><a href="#local-6989586621681162058"><span class="hs-identifier hs-var hs-var">imported_modules</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ImportedModsVal -&gt; ModuleName
</span><a href="GHC.Driver.Types.html#imv_name"><span class="hs-identifier hs-var hs-var">imv_name</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681162056"><span class="hs-identifier hs-var">imv</span></a></span><span>
</span><span id="line-279"></span><span>                       </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681162055"><span class="annot"><span class="annottext">[ImportedBy]
</span><a href="#local-6989586621681162055"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ModuleEnv [ImportedBy] -&gt; [[ImportedBy]]
forall a. ModuleEnv a -&gt; [a]
</span><a href="GHC.Unit.Module.Env.html#moduleEnvElts"><span class="hs-identifier hs-var">moduleEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">(ModuleEnv [ImportedBy] -&gt; [[ImportedBy]])
-&gt; ModuleEnv [ImportedBy] -&gt; [[ImportedBy]]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ImportAvails -&gt; ModuleEnv [ImportedBy]
</span><a href="GHC.Tc.Types.html#imp_mods"><span class="hs-identifier hs-var hs-var">imp_mods</span></a></span><span> </span><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681162083"><span class="hs-identifier hs-var">imports</span></a></span><span>
</span><span id="line-280"></span><span>                       </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681162056"><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681162056"><span class="hs-identifier hs-var">imv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ImportedBy] -&gt; [ImportedModsVal]
</span><a href="GHC.Driver.Types.html#importedByUser"><span class="hs-identifier hs-var">importedByUser</span></a></span><span> </span><span class="annot"><span class="annottext">[ImportedBy]
</span><a href="#local-6989586621681162055"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-281"></span><span>
</span><span id="line-282"></span><span>    </span><span class="annot"><a href="#local-6989586621681162072"><span class="hs-identifier hs-type">exports_from_item</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-type">ExportAccum</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIE"><span class="hs-identifier hs-type">LIE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-283"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-type">ExportAccum</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIE"><span class="hs-identifier hs-type">LIE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Avail.html#Avails"><span class="hs-identifier hs-type">Avails</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-284"></span><span>    </span><span id="local-6989586621681162072"><span class="annot"><span class="annottext">exports_from_item :: ExportAccum
-&gt; LIE GhcPs
-&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo])))
</span><a href="#local-6989586621681162072"><span class="hs-identifier hs-var hs-var">exports_from_item</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-type">ExportAccum</span></a></span><span> </span><span id="local-6989586621681162051"><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681162051"><span class="hs-identifier hs-var">occs</span></a></span></span><span> </span><span id="local-6989586621681162050"><span class="annot"><span class="annottext">UniqSet ModuleName
</span><a href="#local-6989586621681162050"><span class="hs-identifier hs-var">earlier_mods</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-285"></span><span>                      </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681162049"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681162049"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681162048"><span class="annot"><span class="annottext">ie :: IE GhcPs
</span><a href="#local-6989586621681162048"><span class="hs-identifier hs-var">ie</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEModuleContents"><span class="hs-identifier hs-type">IEModuleContents</span></a></span><span> </span><span class="annot"><span class="annottext">XIEModuleContents GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681162046"><span class="annot"><span class="annottext">lmod :: Located ModuleName
</span><a href="#local-6989586621681162046"><span class="hs-identifier hs-var">lmod</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681162045"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681162045"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-286"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681162045"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; UniqSet ModuleName -&gt; Bool
forall a. Uniquable a =&gt; a -&gt; UniqSet a -&gt; Bool
</span><a href="GHC.Types.Unique.Set.html#elementOfUniqSet"><span class="hs-operator hs-var">`elementOfUniqSet`</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet ModuleName
</span><a href="#local-6989586621681162050"><span class="hs-identifier hs-var">earlier_mods</span></a></span><span>    </span><span class="hs-comment">-- Duplicate export of M</span><span>
</span><span id="line-287"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; Bool -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#warnIfFlag"><span class="hs-identifier hs-var">warnIfFlag</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnDuplicateExports"><span class="hs-identifier hs-var">Opt_WarnDuplicateExports</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-288"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#dupModuleExport"><span class="hs-identifier hs-var">dupModuleExport</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681162045"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-289"></span><span>               </span><span class="annot"><span class="annottext">Maybe (ExportAccum, (LIE GhcRn, [AvailInfo]))
-&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo])))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (ExportAccum, (LIE GhcRn, [AvailInfo]))
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-292"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681162041"><span class="annot"><span class="annottext">exportValid :: Bool
</span><a href="#local-6989586621681162041"><span class="hs-identifier hs-var hs-var">exportValid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681162045"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; [ModuleName] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681162058"><span class="hs-identifier hs-var">imported_modules</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-293"></span><span>                                </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681162082"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; ModuleName -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681162045"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-294"></span><span>                   </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681162038"><span class="annot"><span class="annottext">gre_prs :: [(GlobalRdrElt, GlobalRdrElt)]
</span><a href="#local-6989586621681162038"><span class="hs-identifier hs-var hs-var">gre_prs</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; [GlobalRdrElt] -&gt; [(GlobalRdrElt, GlobalRdrElt)]
</span><a href="GHC.Types.Name.Reader.html#pickGREsModExp"><span class="hs-identifier hs-var">pickGREsModExp</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681162045"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#globalRdrEnvElts"><span class="hs-identifier hs-var">globalRdrEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681162084"><span class="hs-identifier hs-var">rdr_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-295"></span><span>                   </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681162036"><span class="annot"><span class="annottext">new_exports :: [AvailInfo]
</span><a href="#local-6989586621681162036"><span class="hs-identifier hs-var hs-var">new_exports</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; AvailInfo
</span><a href="GHC.Types.Name.Reader.html#availFromGRE"><span class="hs-identifier hs-var">availFromGRE</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162034"><span class="hs-identifier hs-var">gre'</span></a></span><span>
</span><span id="line-296"></span><span>                                   </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681162033"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162033"><span class="hs-identifier hs-var">gre</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(GlobalRdrElt, GlobalRdrElt)]
</span><a href="#local-6989586621681162038"><span class="hs-identifier hs-var">gre_prs</span></a></span><span>
</span><span id="line-297"></span><span>                                   </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681162034"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162034"><span class="hs-identifier hs-var">gre'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; [GlobalRdrElt]
</span><a href="#local-6989586621681162069"><span class="hs-identifier hs-var">expand_tyty_gre</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162033"><span class="hs-identifier hs-var">gre</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-298"></span><span>                   </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681162032"><span class="annot"><span class="annottext">all_gres :: [GlobalRdrElt]
</span><a href="#local-6989586621681162032"><span class="hs-identifier hs-var hs-var">all_gres</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((GlobalRdrElt, GlobalRdrElt) -&gt; [GlobalRdrElt] -&gt; [GlobalRdrElt])
-&gt; [GlobalRdrElt]
-&gt; [(GlobalRdrElt, GlobalRdrElt)]
-&gt; [GlobalRdrElt]
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681162030"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162030"><span class="hs-identifier hs-var">gre1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681162029"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162029"><span class="hs-identifier hs-var">gre2</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681162028"><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681162028"><span class="hs-identifier hs-var">gres</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162030"><span class="hs-identifier hs-var">gre1</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; [GlobalRdrElt] -&gt; [GlobalRdrElt]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681162029"><span class="hs-identifier hs-var">gre2</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; [GlobalRdrElt] -&gt; [GlobalRdrElt]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681162028"><span class="hs-identifier hs-var">gres</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[(GlobalRdrElt, GlobalRdrElt)]
</span><a href="#local-6989586621681162038"><span class="hs-identifier hs-var">gre_prs</span></a></span><span>
</span><span id="line-299"></span><span>                   </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681162027"><span class="annot"><span class="annottext">mods :: UniqSet ModuleName
</span><a href="#local-6989586621681162027"><span class="hs-identifier hs-var hs-var">mods</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSet ModuleName -&gt; ModuleName -&gt; UniqSet ModuleName
forall a. Uniquable a =&gt; UniqSet a -&gt; a -&gt; UniqSet a
</span><a href="GHC.Types.Unique.Set.html#addOneToUniqSet"><span class="hs-identifier hs-var">addOneToUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet ModuleName
</span><a href="#local-6989586621681162050"><span class="hs-identifier hs-var">earlier_mods</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681162045"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-300"></span><span>                   </span><span class="hs-special">}</span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#checkErr"><span class="hs-identifier hs-var">checkErr</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681162041"><span class="hs-identifier hs-var">exportValid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#moduleNotImported"><span class="hs-identifier hs-var">moduleNotImported</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681162045"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; Bool -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#warnIfFlag"><span class="hs-identifier hs-var">warnIfFlag</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnDodgyExports"><span class="hs-identifier hs-var">Opt_WarnDodgyExports</span></a></span><span>
</span><span id="line-304"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681162041"><span class="hs-identifier hs-var">exportValid</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[(GlobalRdrElt, GlobalRdrElt)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(GlobalRdrElt, GlobalRdrElt)]
</span><a href="#local-6989586621681162038"><span class="hs-identifier hs-var">gre_prs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-305"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#nullModuleExport"><span class="hs-identifier hs-var">nullModuleExport</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681162045"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-306"></span><span>
</span><span id="line-307"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;efa&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681162045"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681162032"><span class="hs-identifier hs-var">all_gres</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-308"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt] -&gt; TcRn ()
</span><a href="GHC.Rename.Env.html#addUsedGREs"><span class="hs-identifier hs-var">addUsedGREs</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681162032"><span class="hs-identifier hs-var">all_gres</span></a></span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span>             </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681162018"><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681162018"><span class="hs-identifier hs-var">occs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IE GhcPs -&gt; ExportOccMap -&gt; [AvailInfo] -&gt; RnM ExportOccMap
</span><a href="GHC.Tc.Gen.Export.html#check_occs"><span class="hs-identifier hs-var">check_occs</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681162048"><span class="hs-identifier hs-var">ie</span></a></span><span> </span><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681162051"><span class="hs-identifier hs-var">occs</span></a></span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681162036"><span class="hs-identifier hs-var">new_exports</span></a></span><span>
</span><span id="line-311"></span><span>                      </span><span class="hs-comment">-- This check_occs not only finds conflicts</span><span>
</span><span id="line-312"></span><span>                      </span><span class="hs-comment">-- between this item and others, but also</span><span>
</span><span id="line-313"></span><span>                      </span><span class="hs-comment">-- internally within this item.  That is, if</span><span>
</span><span id="line-314"></span><span>                      </span><span class="hs-comment">-- 'M.x' is in scope in several ways, we'll have</span><span>
</span><span id="line-315"></span><span>                      </span><span class="hs-comment">-- several members of mod_avails with the same</span><span>
</span><span id="line-316"></span><span>                      </span><span class="hs-comment">-- OccName.</span><span>
</span><span id="line-317"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;export_mod&quot;</span></span><span>
</span><span id="line-318"></span><span>                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681162045"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-319"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[AvailInfo] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681162036"><span class="hs-identifier hs-var">new_exports</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-320"></span><span>
</span><span id="line-321"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe (ExportAccum, (LIE GhcRn, [AvailInfo]))
-&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo])))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ExportAccum, (LIE GhcRn, [AvailInfo]))
-&gt; Maybe (ExportAccum, (LIE GhcRn, [AvailInfo]))
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">ExportOccMap -&gt; UniqSet ModuleName -&gt; ExportAccum
</span><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-var">ExportAccum</span></a></span><span> </span><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681162018"><span class="hs-identifier hs-var">occs'</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet ModuleName
</span><a href="#local-6989586621681162027"><span class="hs-identifier hs-var">mods</span></a></span><span>
</span><span id="line-322"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; IE GhcRn -&gt; LIE GhcRn
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681162049"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XIEModuleContents GhcRn -&gt; Located ModuleName -&gt; IE GhcRn
forall pass.
XIEModuleContents pass -&gt; Located ModuleName -&gt; IE pass
</span><a href="GHC.Hs.ImpExp.html#IEModuleContents"><span class="hs-identifier hs-var">IEModuleContents</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XIEModuleContents GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">Located ModuleName
</span><a href="#local-6989586621681162046"><span class="hs-identifier hs-var">lmod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-323"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681162036"><span class="hs-identifier hs-var">new_exports</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-324"></span><span>
</span><span id="line-325"></span><span>    </span><span class="annot"><a href="#local-6989586621681162072"><span class="hs-identifier hs-var">exports_from_item</span></a></span><span> </span><span id="local-6989586621681162015"><span class="annot"><span class="annottext">acc :: ExportAccum
</span><a href="#local-6989586621681162015"><span class="hs-identifier hs-var">acc</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-type">ExportAccum</span></a></span><span> </span><span id="local-6989586621681162014"><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681162014"><span class="hs-identifier hs-var">occs</span></a></span></span><span> </span><span id="local-6989586621681162013"><span class="annot"><span class="annottext">UniqSet ModuleName
</span><a href="#local-6989586621681162013"><span class="hs-identifier hs-var">mods</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681162012"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681162012"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681162011"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681162011"><span class="hs-identifier hs-var">ie</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-326"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">IE GhcPs -&gt; Bool
</span><a href="GHC.Tc.Gen.Export.html#isDoc"><span class="hs-identifier hs-var">isDoc</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681162011"><span class="hs-identifier hs-var">ie</span></a></span><span>
</span><span id="line-327"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681162009"><span class="annot"><span class="annottext">IE GhcRn
</span><a href="#local-6989586621681162009"><span class="hs-identifier hs-var">new_ie</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IE GhcPs -&gt; RnM (IE GhcRn)
</span><a href="#local-6989586621681162008"><span class="hs-identifier hs-var">lookup_doc_ie</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681162011"><span class="hs-identifier hs-var">ie</span></a></span><span>
</span><span id="line-328"></span><span>             </span><span class="annot"><span class="annottext">Maybe (ExportAccum, (LIE GhcRn, [AvailInfo]))
-&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo])))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ExportAccum, (LIE GhcRn, [AvailInfo]))
-&gt; Maybe (ExportAccum, (LIE GhcRn, [AvailInfo]))
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExportAccum
</span><a href="#local-6989586621681162015"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; IE GhcRn -&gt; LIE GhcRn
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681162012"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcRn
</span><a href="#local-6989586621681162009"><span class="hs-identifier hs-var">new_ie</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-329"></span><span>
</span><span id="line-330"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-331"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681162007"><span class="annot"><span class="annottext">IE GhcRn
</span><a href="#local-6989586621681162007"><span class="hs-identifier hs-var">new_ie</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681162006"><span class="annot"><span class="annottext">AvailInfo
</span><a href="#local-6989586621681162006"><span class="hs-identifier hs-var">avail</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IE GhcPs -&gt; RnM (IE GhcRn, AvailInfo)
</span><a href="#local-6989586621681162005"><span class="hs-identifier hs-var">lookup_ie</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681162011"><span class="hs-identifier hs-var">ie</span></a></span><span>
</span><span id="line-332"></span><span>             </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Builtin.Names.html#isUnboundName"><span class="hs-identifier hs-var">isUnboundName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IE GhcRn -&gt; IdP GhcRn
forall (p :: Pass). IE (GhcPass p) -&gt; IdP (GhcPass p)
</span><a href="GHC.Hs.ImpExp.html#ieName"><span class="hs-identifier hs-var">ieName</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcRn
</span><a href="#local-6989586621681162007"><span class="hs-identifier hs-var">new_ie</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-333"></span><span>                  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe (ExportAccum, (LIE GhcRn, [AvailInfo]))
-&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo])))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (ExportAccum, (LIE GhcRn, [AvailInfo]))
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>    </span><span class="hs-comment">-- Avoid error cascade</span><span>
</span><span id="line-334"></span><span>                  </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span>                    </span><span id="local-6989586621681162002"><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681162002"><span class="hs-identifier hs-var">occs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IE GhcPs -&gt; ExportOccMap -&gt; [AvailInfo] -&gt; RnM ExportOccMap
</span><a href="GHC.Tc.Gen.Export.html#check_occs"><span class="hs-identifier hs-var">check_occs</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681162011"><span class="hs-identifier hs-var">ie</span></a></span><span> </span><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681162014"><span class="hs-identifier hs-var">occs</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">AvailInfo
</span><a href="#local-6989586621681162006"><span class="hs-identifier hs-var">avail</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-337"></span><span>
</span><span id="line-338"></span><span>                    </span><span class="annot"><span class="annottext">Maybe (ExportAccum, (LIE GhcRn, [AvailInfo]))
-&gt; TcRn (Maybe (ExportAccum, (LIE GhcRn, [AvailInfo])))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ExportAccum, (LIE GhcRn, [AvailInfo]))
-&gt; Maybe (ExportAccum, (LIE GhcRn, [AvailInfo]))
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">ExportOccMap -&gt; UniqSet ModuleName -&gt; ExportAccum
</span><a href="GHC.Tc.Gen.Export.html#ExportAccum"><span class="hs-identifier hs-var">ExportAccum</span></a></span><span> </span><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681162002"><span class="hs-identifier hs-var">occs'</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSet ModuleName
</span><a href="#local-6989586621681162013"><span class="hs-identifier hs-var">mods</span></a></span><span>
</span><span id="line-339"></span><span>                                 </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; IE GhcRn -&gt; LIE GhcRn
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681162012"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcRn
</span><a href="#local-6989586621681162007"><span class="hs-identifier hs-var">new_ie</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">AvailInfo
</span><a href="#local-6989586621681162006"><span class="hs-identifier hs-var">avail</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-340"></span><span>
</span><span id="line-341"></span><span>    </span><span class="hs-comment">-------------</span><span>
</span><span id="line-342"></span><span>    </span><span class="annot"><a href="#local-6989586621681162005"><span class="hs-identifier hs-type">lookup_ie</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Avail.html#AvailInfo"><span class="hs-identifier hs-type">AvailInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span>    </span><span id="local-6989586621681162005"><span class="annot"><span class="annottext">lookup_ie :: IE GhcPs -&gt; RnM (IE GhcRn, AvailInfo)
</span><a href="#local-6989586621681162005"><span class="hs-identifier hs-var hs-var">lookup_ie</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEVar"><span class="hs-identifier hs-type">IEVar</span></a></span><span> </span><span class="annot"><span class="annottext">XIEVar GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681162001"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681162001"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681162000"><span class="annot"><span class="annottext">IEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681162000"><span class="hs-identifier hs-var">rdr</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-344"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681161999"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161999"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161998"><span class="annot"><span class="annottext">AvailInfo
</span><a href="#local-6989586621681161998"><span class="hs-identifier hs-var">avail</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; RnM (Name, AvailInfo)
</span><a href="GHC.Rename.Env.html#lookupGreAvailRn"><span class="hs-identifier hs-var">lookupGreAvailRn</span></a></span><span> </span><span class="annot"><span class="annottext">(RdrName -&gt; RnM (Name, AvailInfo))
-&gt; RdrName -&gt; RnM (Name, AvailInfo)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IEWrappedName RdrName -&gt; RdrName
forall name. IEWrappedName name -&gt; name
</span><a href="GHC.Hs.ImpExp.html#ieWrappedName"><span class="hs-identifier hs-var">ieWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">IEWrappedName RdrName
IEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681162000"><span class="hs-identifier hs-var">rdr</span></a></span><span>
</span><span id="line-345"></span><span>             </span><span class="annot"><span class="annottext">(IE GhcRn, AvailInfo) -&gt; RnM (IE GhcRn, AvailInfo)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XIEVar GhcRn -&gt; LIEWrappedName (IdP GhcRn) -&gt; IE GhcRn
forall pass. XIEVar pass -&gt; LIEWrappedName (IdP pass) -&gt; IE pass
</span><a href="GHC.Hs.ImpExp.html#IEVar"><span class="hs-identifier hs-var">IEVar</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XIEVar GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; IEWrappedName Name -&gt; GenLocated SrcSpan (IEWrappedName Name)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681162001"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IEWrappedName RdrName -&gt; Name -&gt; IEWrappedName Name
forall name1 name2.
IEWrappedName name1 -&gt; name2 -&gt; IEWrappedName name2
</span><a href="GHC.Hs.ImpExp.html#replaceWrappedName"><span class="hs-identifier hs-var">replaceWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">IEWrappedName RdrName
IEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681162000"><span class="hs-identifier hs-var">rdr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161999"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">AvailInfo
</span><a href="#local-6989586621681161998"><span class="hs-identifier hs-var">avail</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-346"></span><span>
</span><span id="line-347"></span><span>    </span><span class="annot"><a href="#local-6989586621681162005"><span class="hs-identifier hs-var">lookup_ie</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEThingAbs"><span class="hs-identifier hs-type">IEThingAbs</span></a></span><span> </span><span class="annot"><span class="annottext">XIEThingAbs GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681161993"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681161993"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681161992"><span class="annot"><span class="annottext">IEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161992"><span class="hs-identifier hs-var">rdr</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-348"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681161991"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161991"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161990"><span class="annot"><span class="annottext">AvailInfo
</span><a href="#local-6989586621681161990"><span class="hs-identifier hs-var">avail</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; RnM (Name, AvailInfo)
</span><a href="GHC.Rename.Env.html#lookupGreAvailRn"><span class="hs-identifier hs-var">lookupGreAvailRn</span></a></span><span> </span><span class="annot"><span class="annottext">(RdrName -&gt; RnM (Name, AvailInfo))
-&gt; RdrName -&gt; RnM (Name, AvailInfo)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IEWrappedName RdrName -&gt; RdrName
forall name. IEWrappedName name -&gt; name
</span><a href="GHC.Hs.ImpExp.html#ieWrappedName"><span class="hs-identifier hs-var">ieWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">IEWrappedName RdrName
IEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161992"><span class="hs-identifier hs-var">rdr</span></a></span><span>
</span><span id="line-349"></span><span>             </span><span class="annot"><span class="annottext">(IE GhcRn, AvailInfo) -&gt; RnM (IE GhcRn, AvailInfo)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XIEThingAbs GhcRn -&gt; LIEWrappedName (IdP GhcRn) -&gt; IE GhcRn
forall pass.
XIEThingAbs pass -&gt; LIEWrappedName (IdP pass) -&gt; IE pass
</span><a href="GHC.Hs.ImpExp.html#IEThingAbs"><span class="hs-identifier hs-var">IEThingAbs</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XIEThingAbs GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; IEWrappedName Name -&gt; GenLocated SrcSpan (IEWrappedName Name)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681161993"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IEWrappedName RdrName -&gt; Name -&gt; IEWrappedName Name
forall name1 name2.
IEWrappedName name1 -&gt; name2 -&gt; IEWrappedName name2
</span><a href="GHC.Hs.ImpExp.html#replaceWrappedName"><span class="hs-identifier hs-var">replaceWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">IEWrappedName RdrName
IEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161992"><span class="hs-identifier hs-var">rdr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161991"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-350"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">AvailInfo
</span><a href="#local-6989586621681161990"><span class="hs-identifier hs-var">avail</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-351"></span><span>
</span><span id="line-352"></span><span>    </span><span class="annot"><a href="#local-6989586621681162005"><span class="hs-identifier hs-var">lookup_ie</span></a></span><span> </span><span id="local-6989586621681161989"><span class="annot"><span class="annottext">ie :: IE GhcPs
</span><a href="#local-6989586621681161989"><span class="hs-identifier hs-var">ie</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEThingAll"><span class="hs-identifier hs-type">IEThingAll</span></a></span><span> </span><span class="annot"><span class="annottext">XIEThingAll GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681161987"><span class="annot"><span class="annottext">LIEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161987"><span class="hs-identifier hs-var">n'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-353"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-354"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681161986"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681161986"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161985"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161985"><span class="hs-identifier hs-var">avail</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161984"><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681161984"><span class="hs-identifier hs-var">flds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IE GhcPs
-&gt; Located (IEWrappedName RdrName)
-&gt; RnM (Located Name, [Name], [FieldLabel])
</span><a href="#local-6989586621681161983"><span class="hs-identifier hs-var">lookup_ie_all</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161989"><span class="hs-identifier hs-var">ie</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
LIEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161987"><span class="hs-identifier hs-var">n'</span></a></span><span>
</span><span id="line-355"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681161982"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681161982"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681161986"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-356"></span><span>            </span><span class="annot"><span class="annottext">(IE GhcRn, AvailInfo) -&gt; RnM (IE GhcRn, AvailInfo)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XIEThingAll GhcRn -&gt; LIEWrappedName (IdP GhcRn) -&gt; IE GhcRn
forall pass.
XIEThingAll pass -&gt; LIEWrappedName (IdP pass) -&gt; IE pass
</span><a href="GHC.Hs.ImpExp.html#IEThingAll"><span class="hs-identifier hs-var">IEThingAll</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XIEThingAll GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
-&gt; Name -&gt; GenLocated SrcSpan (IEWrappedName Name)
forall name1 name2.
LIEWrappedName name1 -&gt; name2 -&gt; LIEWrappedName name2
</span><a href="GHC.Hs.ImpExp.html#replaceLWrappedName"><span class="hs-identifier hs-var">replaceLWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
LIEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161987"><span class="hs-identifier hs-var">n'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681161986"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-357"></span><span>                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; [FieldLabel] -&gt; AvailInfo
</span><a href="GHC.Types.Avail.html#AvailTC"><span class="hs-identifier hs-var">AvailTC</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161982"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161982"><span class="hs-identifier hs-var">name</span></a></span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; [Name]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161985"><span class="hs-identifier hs-var">avail</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681161984"><span class="hs-identifier hs-var">flds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-358"></span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span>    </span><span class="annot"><a href="#local-6989586621681162005"><span class="hs-identifier hs-var">lookup_ie</span></a></span><span> </span><span id="local-6989586621681161979"><span class="annot"><span class="annottext">ie :: IE GhcPs
</span><a href="#local-6989586621681161979"><span class="hs-identifier hs-var">ie</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEThingWith"><span class="hs-identifier hs-type">IEThingWith</span></a></span><span> </span><span class="annot"><span class="annottext">XIEThingWith GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681161977"><span class="annot"><span class="annottext">LIEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161977"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681161976"><span class="annot"><span class="annottext">IEWildcard
</span><a href="#local-6989586621681161976"><span class="hs-identifier hs-var">wc</span></a></span></span><span> </span><span id="local-6989586621681161975"><span class="annot"><span class="annottext">[LIEWrappedName (IdP GhcPs)]
</span><a href="#local-6989586621681161975"><span class="hs-identifier hs-var">sub_rdrs</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Located (FieldLbl (IdP GhcPs))]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-361"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-362"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681161974"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681161974"><span class="hs-identifier hs-var">lname</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161973"><span class="annot"><span class="annottext">[GenLocated SrcSpan (IEWrappedName Name)]
</span><a href="#local-6989586621681161973"><span class="hs-identifier hs-var">subs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161972"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161972"><span class="hs-identifier hs-var">avails</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161971"><span class="annot"><span class="annottext">[Located FieldLabel]
</span><a href="#local-6989586621681161971"><span class="hs-identifier hs-var">flds</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-363"></span><span>              </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IE GhcPs
-&gt; TcM
     (Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
      [Located FieldLabel])
-&gt; TcM
     (Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
      [Located FieldLabel])
forall (p :: Pass) a.
OutputableBndrId p =&gt;
IE (GhcPass p) -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Gen.Export.html#addExportErrCtxt"><span class="hs-identifier hs-var">addExportErrCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161979"><span class="hs-identifier hs-var">ie</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM
   (Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
    [Located FieldLabel])
 -&gt; TcM
      (Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
       [Located FieldLabel]))
-&gt; TcM
     (Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
      [Located FieldLabel])
-&gt; TcM
     (Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
      [Located FieldLabel])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
-&gt; [Located (IEWrappedName RdrName)]
-&gt; TcM
     (Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
      [Located FieldLabel])
</span><a href="#local-6989586621681161969"><span class="hs-identifier hs-var">lookup_ie_with</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
LIEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161977"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (IEWrappedName RdrName)]
[LIEWrappedName (IdP GhcPs)]
</span><a href="#local-6989586621681161975"><span class="hs-identifier hs-var">sub_rdrs</span></a></span><span>
</span><span id="line-364"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161968"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161968"><span class="hs-identifier hs-var">all_avail</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161967"><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681161967"><span class="hs-identifier hs-var">all_flds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-365"></span><span>              </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">IEWildcard
</span><a href="#local-6989586621681161976"><span class="hs-identifier hs-var">wc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-366"></span><span>                </span><span class="annot"><span class="annottext">IEWildcard
</span><a href="GHC.Hs.ImpExp.html#NoIEWildcard"><span class="hs-identifier hs-var">NoIEWildcard</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Located Name, [Name], [FieldLabel])
-&gt; RnM (Located Name, [Name], [FieldLabel])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681161974"><span class="hs-identifier hs-var">lname</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-367"></span><span>                </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEWildcard"><span class="hs-identifier hs-type">IEWildcard</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IE GhcPs
-&gt; Located (IEWrappedName RdrName)
-&gt; RnM (Located Name, [Name], [FieldLabel])
</span><a href="#local-6989586621681161983"><span class="hs-identifier hs-var">lookup_ie_all</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161979"><span class="hs-identifier hs-var">ie</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
LIEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161977"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-368"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681161964"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681161964"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681161974"><span class="hs-identifier hs-var">lname</span></a></span><span>
</span><span id="line-369"></span><span>            </span><span class="annot"><span class="annottext">(IE GhcRn, AvailInfo) -&gt; RnM (IE GhcRn, AvailInfo)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XIEThingWith GhcRn
-&gt; LIEWrappedName (IdP GhcRn)
-&gt; IEWildcard
-&gt; [LIEWrappedName (IdP GhcRn)]
-&gt; [Located (FieldLbl (IdP GhcRn))]
-&gt; IE GhcRn
forall pass.
XIEThingWith pass
-&gt; LIEWrappedName (IdP pass)
-&gt; IEWildcard
-&gt; [LIEWrappedName (IdP pass)]
-&gt; [Located (FieldLbl (IdP pass))]
-&gt; IE pass
</span><a href="GHC.Hs.ImpExp.html#IEThingWith"><span class="hs-identifier hs-var">IEThingWith</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XIEThingWith GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
-&gt; Name -&gt; GenLocated SrcSpan (IEWrappedName Name)
forall name1 name2.
LIEWrappedName name1 -&gt; name2 -&gt; LIEWrappedName name2
</span><a href="GHC.Hs.ImpExp.html#replaceLWrappedName"><span class="hs-identifier hs-var">replaceLWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
LIEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161977"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161964"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IEWildcard
</span><a href="#local-6989586621681161976"><span class="hs-identifier hs-var">wc</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (IEWrappedName Name)]
[LIEWrappedName (IdP GhcRn)]
</span><a href="#local-6989586621681161973"><span class="hs-identifier hs-var">subs</span></a></span><span>
</span><span id="line-370"></span><span>                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located FieldLabel]
</span><a href="#local-6989586621681161971"><span class="hs-identifier hs-var">flds</span></a></span><span> </span><span class="annot"><span class="annottext">[Located FieldLabel]
-&gt; [Located FieldLabel] -&gt; [Located FieldLabel]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(FieldLabel -&gt; Located FieldLabel)
-&gt; [FieldLabel] -&gt; [Located FieldLabel]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">FieldLabel -&gt; Located FieldLabel
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681161967"><span class="hs-identifier hs-var">all_flds</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-371"></span><span>                    </span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; [FieldLabel] -&gt; AvailInfo
</span><a href="GHC.Types.Avail.html#AvailTC"><span class="hs-identifier hs-var">AvailTC</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161964"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161964"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; [Name]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161972"><span class="hs-identifier hs-var">avails</span></a></span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; [Name] -&gt; [Name]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161968"><span class="hs-identifier hs-var">all_avail</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-372"></span><span>                                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located FieldLabel -&gt; FieldLabel)
-&gt; [Located FieldLabel] -&gt; [FieldLabel]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Located FieldLabel -&gt; FieldLabel
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">[Located FieldLabel]
</span><a href="#local-6989586621681161971"><span class="hs-identifier hs-var">flds</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLabel] -&gt; [FieldLabel] -&gt; [FieldLabel]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681161967"><span class="hs-identifier hs-var">all_flds</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-373"></span><span>
</span><span id="line-374"></span><span>
</span><span id="line-375"></span><span>    </span><span class="annot"><a href="#local-6989586621681162005"><span class="hs-identifier hs-var">lookup_ie</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; RnM (IE GhcRn, AvailInfo)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lookup_ie&quot;</span></span><span>    </span><span class="hs-comment">-- Other cases covered earlier</span><span>
</span><span id="line-376"></span><span>
</span><span id="line-377"></span><span>
</span><span id="line-378"></span><span>    </span><span class="annot"><a href="#local-6989586621681161969"><span class="hs-identifier hs-type">lookup_ie_with</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIEWrappedName"><span class="hs-identifier hs-type">LIEWrappedName</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIEWrappedName"><span class="hs-identifier hs-type">LIEWrappedName</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-379"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIEWrappedName"><span class="hs-identifier hs-type">LIEWrappedName</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-380"></span><span>                           </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-381"></span><span>    </span><span id="local-6989586621681161969"><span class="annot"><span class="annottext">lookup_ie_with :: Located (IEWrappedName RdrName)
-&gt; [Located (IEWrappedName RdrName)]
-&gt; TcM
     (Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
      [Located FieldLabel])
</span><a href="#local-6989586621681161969"><span class="hs-identifier hs-var hs-var">lookup_ie_with</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681161962"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681161962"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681161961"><span class="annot"><span class="annottext">IEWrappedName RdrName
</span><a href="#local-6989586621681161961"><span class="hs-identifier hs-var">rdr</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681161960"><span class="annot"><span class="annottext">[Located (IEWrappedName RdrName)]
</span><a href="#local-6989586621681161960"><span class="hs-identifier hs-var">sub_rdrs</span></a></span></span><span>
</span><span id="line-382"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681161959"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161959"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Env.html#lookupGlobalOccRn"><span class="hs-identifier hs-var">lookupGlobalOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">(RdrName -&gt; RnM Name) -&gt; RdrName -&gt; RnM Name
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IEWrappedName RdrName -&gt; RdrName
forall name. IEWrappedName name -&gt; name
</span><a href="GHC.Hs.ImpExp.html#ieWrappedName"><span class="hs-identifier hs-var">ieWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">IEWrappedName RdrName
</span><a href="#local-6989586621681161961"><span class="hs-identifier hs-var">rdr</span></a></span><span>
</span><span id="line-383"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681161957"><span class="annot"><span class="annottext">[GenLocated SrcSpan (IEWrappedName Name)]
</span><a href="#local-6989586621681161957"><span class="hs-identifier hs-var">non_flds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161956"><span class="annot"><span class="annottext">[Located FieldLabel]
</span><a href="#local-6989586621681161956"><span class="hs-identifier hs-var">flds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name
-&gt; [Located (IEWrappedName RdrName)]
-&gt; RnM
     ([GenLocated SrcSpan (IEWrappedName Name)], [Located FieldLabel])
</span><a href="GHC.Tc.Gen.Export.html#lookupChildrenExport"><span class="hs-identifier hs-var">lookupChildrenExport</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161959"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (IEWrappedName RdrName)]
</span><a href="#local-6989586621681161960"><span class="hs-identifier hs-var">sub_rdrs</span></a></span><span>
</span><span id="line-384"></span><span>             </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Builtin.Names.html#isUnboundName"><span class="hs-identifier hs-var">isUnboundName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161959"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-385"></span><span>                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
 [Located FieldLabel])
-&gt; TcM
     (Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
      [Located FieldLabel])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681161962"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161959"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161959"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-386"></span><span>                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">(Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
 [Located FieldLabel])
-&gt; TcM
     (Located Name, [GenLocated SrcSpan (IEWrappedName Name)], [Name],
      [Located FieldLabel])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681161962"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161959"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (IEWrappedName Name)]
</span><a href="#local-6989586621681161957"><span class="hs-identifier hs-var">non_flds</span></a></span><span>
</span><span id="line-387"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (IEWrappedName Name) -&gt; Name)
-&gt; [GenLocated SrcSpan (IEWrappedName Name)] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IEWrappedName Name -&gt; Name
forall name. IEWrappedName name -&gt; name
</span><a href="GHC.Hs.ImpExp.html#ieWrappedName"><span class="hs-identifier hs-var">ieWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">(IEWrappedName Name -&gt; Name)
-&gt; (GenLocated SrcSpan (IEWrappedName Name) -&gt; IEWrappedName Name)
-&gt; GenLocated SrcSpan (IEWrappedName Name)
-&gt; Name
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (IEWrappedName Name) -&gt; IEWrappedName Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (IEWrappedName Name)]
</span><a href="#local-6989586621681161957"><span class="hs-identifier hs-var">non_flds</span></a></span><span>
</span><span id="line-388"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Located FieldLabel]
</span><a href="#local-6989586621681161956"><span class="hs-identifier hs-var">flds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-389"></span><span>
</span><span id="line-390"></span><span>    </span><span class="annot"><a href="#local-6989586621681161983"><span class="hs-identifier hs-type">lookup_ie_all</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIEWrappedName"><span class="hs-identifier hs-type">LIEWrappedName</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span>
</span><span id="line-391"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-392"></span><span>    </span><span id="local-6989586621681161983"><span class="annot"><span class="annottext">lookup_ie_all :: IE GhcPs
-&gt; Located (IEWrappedName RdrName)
-&gt; RnM (Located Name, [Name], [FieldLabel])
</span><a href="#local-6989586621681161983"><span class="hs-identifier hs-var hs-var">lookup_ie_all</span></a></span></span><span> </span><span id="local-6989586621681161954"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161954"><span class="hs-identifier hs-var">ie</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681161953"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681161953"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681161952"><span class="annot"><span class="annottext">IEWrappedName RdrName
</span><a href="#local-6989586621681161952"><span class="hs-identifier hs-var">rdr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-393"></span><span>          </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681161951"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161951"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Env.html#lookupGlobalOccRn"><span class="hs-identifier hs-var">lookupGlobalOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">(RdrName -&gt; RnM Name) -&gt; RdrName -&gt; RnM Name
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IEWrappedName RdrName -&gt; RdrName
forall name. IEWrappedName name -&gt; name
</span><a href="GHC.Hs.ImpExp.html#ieWrappedName"><span class="hs-identifier hs-var">ieWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">IEWrappedName RdrName
</span><a href="#local-6989586621681161952"><span class="hs-identifier hs-var">rdr</span></a></span><span>
</span><span id="line-394"></span><span>             </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681161950"><span class="annot"><span class="annottext">gres :: [GlobalRdrElt]
</span><a href="#local-6989586621681161950"><span class="hs-identifier hs-var hs-var">gres</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameEnv [GlobalRdrElt] -&gt; Name -&gt; [GlobalRdrElt]
forall a. NameEnv [a] -&gt; Name -&gt; [a]
</span><a href="GHC.Rename.Names.html#findChildren"><span class="hs-identifier hs-var">findChildren</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv [GlobalRdrElt]
</span><a href="#local-6989586621681162071"><span class="hs-identifier hs-var">kids_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161951"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-395"></span><span>                 </span><span class="hs-special">(</span><span id="local-6989586621681161948"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161948"><span class="hs-identifier hs-var">non_flds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161947"><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681161947"><span class="hs-identifier hs-var">flds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt] -&gt; ([Name], [FieldLabel])
</span><a href="GHC.Tc.Gen.Export.html#classifyGREs"><span class="hs-identifier hs-var">classifyGREs</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681161950"><span class="hs-identifier hs-var">gres</span></a></span><span>
</span><span id="line-396"></span><span>             </span><span class="annot"><span class="annottext">RdrName -&gt; [GlobalRdrElt] -&gt; TcRn ()
</span><a href="#local-6989586621681161945"><span class="hs-identifier hs-var">addUsedKids</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IEWrappedName RdrName -&gt; RdrName
forall name. IEWrappedName name -&gt; name
</span><a href="GHC.Hs.ImpExp.html#ieWrappedName"><span class="hs-identifier hs-var">ieWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">IEWrappedName RdrName
</span><a href="#local-6989586621681161952"><span class="hs-identifier hs-var">rdr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681161950"><span class="hs-identifier hs-var">gres</span></a></span><span>
</span><span id="line-397"></span><span>             </span><span id="local-6989586621681161944"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681161944"><span class="hs-identifier hs-var">warnDodgyExports</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; IOEnv (Env TcGblEnv TcLclEnv) Bool
forall gbl lcl. WarningFlag -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#woptM"><span class="hs-identifier hs-var">woptM</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnDodgyExports"><span class="hs-identifier hs-var">Opt_WarnDodgyExports</span></a></span><span>
</span><span id="line-398"></span><span>             </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[GlobalRdrElt] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681161950"><span class="hs-identifier hs-var">gres</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-399"></span><span>                  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isTyConName"><span class="hs-identifier hs-var">isTyConName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161951"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-400"></span><span>                  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681161944"><span class="hs-identifier hs-var">warnDodgyExports</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-401"></span><span>                           </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addWarn"><span class="hs-identifier hs-var">addWarn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnDodgyExports"><span class="hs-identifier hs-var">Opt_WarnDodgyExports</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-402"></span><span>                                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#dodgyExportWarn"><span class="hs-identifier hs-var">dodgyExportWarn</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161951"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-403"></span><span>                  </span><span class="hs-keyword">else</span><span> </span><span class="hs-comment">-- This occurs when you export T(..), but</span><span>
</span><span id="line-404"></span><span>                       </span><span class="hs-comment">-- only import T abstractly, or T is a synonym.</span><span>
</span><span id="line-405"></span><span>                       </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IE GhcPs -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#exportItemErr"><span class="hs-identifier hs-var">exportItemErr</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161954"><span class="hs-identifier hs-var">ie</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-406"></span><span>             </span><span class="annot"><span class="annottext">(Located Name, [Name], [FieldLabel])
-&gt; RnM (Located Name, [Name], [FieldLabel])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681161953"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161951"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161948"><span class="hs-identifier hs-var">non_flds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681161947"><span class="hs-identifier hs-var">flds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-407"></span><span>
</span><span id="line-408"></span><span>    </span><span class="hs-comment">-------------</span><span>
</span><span id="line-409"></span><span>    </span><span class="annot"><a href="#local-6989586621681162008"><span class="hs-identifier hs-type">lookup_doc_ie</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-410"></span><span>    </span><span id="local-6989586621681162008"><span class="annot"><span class="annottext">lookup_doc_ie :: IE GhcPs -&gt; RnM (IE GhcRn)
</span><a href="#local-6989586621681162008"><span class="hs-identifier hs-var hs-var">lookup_doc_ie</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEGroup"><span class="hs-identifier hs-type">IEGroup</span></a></span><span> </span><span class="annot"><span class="annottext">XIEGroup GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681161936"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681161936"><span class="hs-identifier hs-var">lev</span></a></span></span><span> </span><span id="local-6989586621681161935"><span class="annot"><span class="annottext">HsDocString
</span><a href="#local-6989586621681161935"><span class="hs-identifier hs-var">doc</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681161934"><span class="annot"><span class="annottext">HsDocString
</span><a href="#local-6989586621681161934"><span class="hs-identifier hs-var">rn_doc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsDocString -&gt; RnM HsDocString
</span><a href="GHC.Rename.Doc.html#rnHsDoc"><span class="hs-identifier hs-var">rnHsDoc</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocString
</span><a href="#local-6989586621681161935"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-411"></span><span>                                           </span><span class="annot"><span class="annottext">IE GhcRn -&gt; RnM (IE GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XIEGroup GhcRn -&gt; Int -&gt; HsDocString -&gt; IE GhcRn
forall pass. XIEGroup pass -&gt; Int -&gt; HsDocString -&gt; IE pass
</span><a href="GHC.Hs.ImpExp.html#IEGroup"><span class="hs-identifier hs-var">IEGroup</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XIEGroup GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681161936"><span class="hs-identifier hs-var">lev</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocString
</span><a href="#local-6989586621681161934"><span class="hs-identifier hs-var">rn_doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-412"></span><span>    </span><span class="annot"><a href="#local-6989586621681162008"><span class="hs-identifier hs-var">lookup_doc_ie</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEDoc"><span class="hs-identifier hs-type">IEDoc</span></a></span><span> </span><span class="annot"><span class="annottext">XIEDoc GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681161932"><span class="annot"><span class="annottext">HsDocString
</span><a href="#local-6989586621681161932"><span class="hs-identifier hs-var">doc</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681161931"><span class="annot"><span class="annottext">HsDocString
</span><a href="#local-6989586621681161931"><span class="hs-identifier hs-var">rn_doc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsDocString -&gt; RnM HsDocString
</span><a href="GHC.Rename.Doc.html#rnHsDoc"><span class="hs-identifier hs-var">rnHsDoc</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocString
</span><a href="#local-6989586621681161932"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-413"></span><span>                                           </span><span class="annot"><span class="annottext">IE GhcRn -&gt; RnM (IE GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XIEDoc GhcRn -&gt; HsDocString -&gt; IE GhcRn
forall pass. XIEDoc pass -&gt; HsDocString -&gt; IE pass
</span><a href="GHC.Hs.ImpExp.html#IEDoc"><span class="hs-identifier hs-var">IEDoc</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XIEDoc GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocString
</span><a href="#local-6989586621681161931"><span class="hs-identifier hs-var">rn_doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-414"></span><span>    </span><span class="annot"><a href="#local-6989586621681162008"><span class="hs-identifier hs-var">lookup_doc_ie</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEDocNamed"><span class="hs-identifier hs-type">IEDocNamed</span></a></span><span> </span><span class="annot"><span class="annottext">XIEDocNamed GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681161929"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681161929"><span class="hs-identifier hs-var">str</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IE GhcRn -&gt; RnM (IE GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XIEDocNamed GhcRn -&gt; String -&gt; IE GhcRn
forall pass. XIEDocNamed pass -&gt; String -&gt; IE pass
</span><a href="GHC.Hs.ImpExp.html#IEDocNamed"><span class="hs-identifier hs-var">IEDocNamed</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XIEDocNamed GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681161929"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-415"></span><span>    </span><span class="annot"><a href="#local-6989586621681162008"><span class="hs-identifier hs-var">lookup_doc_ie</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; RnM (IE GhcRn)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lookup_doc_ie&quot;</span></span><span>    </span><span class="hs-comment">-- Other cases covered earlier</span><span>
</span><span id="line-416"></span><span>
</span><span id="line-417"></span><span>    </span><span class="hs-comment">-- In an export item M.T(A,B,C), we want to treat the uses of</span><span>
</span><span id="line-418"></span><span>    </span><span class="hs-comment">-- A,B,C as if they were M.A, M.B, M.C</span><span>
</span><span id="line-419"></span><span>    </span><span class="hs-comment">-- Happily pickGREs does just the right thing</span><span>
</span><span id="line-420"></span><span>    </span><span class="annot"><a href="#local-6989586621681161945"><span class="hs-identifier hs-type">addUsedKids</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-421"></span><span>    </span><span id="local-6989586621681161945"><span class="annot"><span class="annottext">addUsedKids :: RdrName -&gt; [GlobalRdrElt] -&gt; TcRn ()
</span><a href="#local-6989586621681161945"><span class="hs-identifier hs-var hs-var">addUsedKids</span></a></span></span><span> </span><span id="local-6989586621681161928"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681161928"><span class="hs-identifier hs-var">parent_rdr</span></a></span></span><span> </span><span id="local-6989586621681161927"><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681161927"><span class="hs-identifier hs-var">kid_gres</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt] -&gt; TcRn ()
</span><a href="GHC.Rename.Env.html#addUsedGREs"><span class="hs-identifier hs-var">addUsedGREs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; [GlobalRdrElt] -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#pickGREs"><span class="hs-identifier hs-var">pickGREs</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681161928"><span class="hs-identifier hs-var">parent_rdr</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681161927"><span class="hs-identifier hs-var">kid_gres</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span>
</span><span id="line-423"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#classifyGREs"><span class="hs-identifier hs-type">classifyGREs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-424"></span><span id="classifyGREs"><span class="annot"><span class="annottext">classifyGREs :: [GlobalRdrElt] -&gt; ([Name], [FieldLabel])
</span><a href="GHC.Tc.Gen.Export.html#classifyGREs"><span class="hs-identifier hs-var hs-var">classifyGREs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Either Name FieldLabel] -&gt; ([Name], [FieldLabel])
forall a b. [Either a b] -&gt; ([a], [b])
</span><a href="../../base/src/Data.Either.html#partitionEithers"><span class="hs-identifier hs-var">partitionEithers</span></a></span><span> </span><span class="annot"><span class="annottext">([Either Name FieldLabel] -&gt; ([Name], [FieldLabel]))
-&gt; ([GlobalRdrElt] -&gt; [Either Name FieldLabel])
-&gt; [GlobalRdrElt]
-&gt; ([Name], [FieldLabel])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; Either Name FieldLabel)
-&gt; [GlobalRdrElt] -&gt; [Either Name FieldLabel]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Either Name FieldLabel
</span><a href="GHC.Tc.Gen.Export.html#classifyGRE"><span class="hs-identifier hs-var">classifyGRE</span></a></span><span>
</span><span id="line-425"></span><span>
</span><span id="line-426"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#classifyGRE"><span class="hs-identifier hs-type">classifyGRE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span>
</span><span id="line-427"></span><span id="classifyGRE"><span class="annot"><span class="annottext">classifyGRE :: GlobalRdrElt -&gt; Either Name FieldLabel
</span><a href="GHC.Tc.Gen.Export.html#classifyGRE"><span class="hs-identifier hs-var hs-var">classifyGRE</span></a></span></span><span> </span><span id="local-6989586621681161924"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681161924"><span class="hs-identifier hs-var">gre</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Parent
</span><a href="GHC.Types.Name.Reader.html#gre_par"><span class="hs-identifier hs-var hs-var">gre_par</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681161924"><span class="hs-identifier hs-var">gre</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-428"></span><span>  </span><span class="annot"><a href="GHC.Types.Name.Reader.html#FldParent"><span class="hs-identifier hs-type">FldParent</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FieldLabel -&gt; Either Name FieldLabel
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; Bool -&gt; Name -&gt; FieldLabel
forall a. FastString -&gt; Bool -&gt; a -&gt; FieldLbl a
</span><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-var">FieldLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; FastString
</span><a href="GHC.Types.Name.Occurrence.html#occNameFS"><span class="hs-identifier hs-var hs-var">occNameFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161919"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161919"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-429"></span><span>  </span><span class="annot"><a href="GHC.Types.Name.Reader.html#FldParent"><span class="hs-identifier hs-type">FldParent</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681161918"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681161918"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FieldLabel -&gt; Either Name FieldLabel
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; Bool -&gt; Name -&gt; FieldLabel
forall a. FastString -&gt; Bool -&gt; a -&gt; FieldLbl a
</span><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-var">FieldLabel</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681161918"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161919"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-430"></span><span>  </span><span class="annot"><span class="annottext">Parent
</span><span class="hs-identifier">_</span></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Either Name FieldLabel
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span>  </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161919"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-431"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-432"></span><span>    </span><span id="local-6989586621681161919"><span class="annot"><span class="annottext">n :: Name
</span><a href="#local-6989586621681161919"><span class="hs-identifier hs-var hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var hs-var">gre_name</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681161924"><span class="hs-identifier hs-var">gre</span></a></span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#isDoc"><span class="hs-identifier hs-type">isDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-435"></span><span id="isDoc"><span class="annot"><span class="annottext">isDoc :: IE GhcPs -&gt; Bool
</span><a href="GHC.Tc.Gen.Export.html#isDoc"><span class="hs-identifier hs-var hs-var">isDoc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEDoc"><span class="hs-identifier hs-type">IEDoc</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-436"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#isDoc"><span class="hs-identifier hs-var">isDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEDocNamed"><span class="hs-identifier hs-type">IEDocNamed</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-437"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#isDoc"><span class="hs-identifier hs-var">isDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEGroup"><span class="hs-identifier hs-type">IEGroup</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-438"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#isDoc"><span class="hs-identifier hs-var">isDoc</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-439"></span><span>
</span><span id="line-440"></span><span class="hs-comment">-- Renaming and typechecking of exports happens after everything else has</span><span>
</span><span id="line-441"></span><span class="hs-comment">-- been typechecked.</span><span>
</span><span id="line-442"></span><span>
</span><span id="line-443"></span><span class="hs-comment">{-
Note [Modules without a module header]
--------------------------------------------------

The Haskell 2010 report says in section 5.1:

&gt;&gt; An abbreviated form of module, consisting only of the module body, is
&gt;&gt; permitted. If this is used, the header is assumed to be
&gt;&gt; &#8216;module Main(main) where&#8217;.

For modules without a module header, this is implemented the
following way:

If the module has a main function in scope:
   Then create a module header and export the main function,
   as if a module header like &#8216;module Main(main) where...&#8217; would exist.
   This has the effect to mark the main function and all top level
   functions called directly or indirectly via main as 'used',
   and later on, unused top-level functions can be reported correctly.
   There is no distinction between GHC and GHCi.
If the module has several main functions in scope:
   Then generate a header as above. The ambiguity is reported later in
   module  `GHC.Tc.Module` function `check_main`.
If the module has NO main function:
   Then export all top-level functions. This marks all top level
   functions as 'used'.
   In GHCi this has the effect, that we don't get any 'non-used' warnings.
   In GHC, however, the 'has-main-module' check in GHC.Tc.Module.checkMain
   fires, and we get the error:
      The IO action &#8216;main&#8217; is not defined in module &#8216;Main&#8217;
-}</span><span>
</span><span id="line-474"></span><span>
</span><span id="line-475"></span><span>
</span><span id="line-476"></span><span class="hs-comment">-- Renaming exports lists is a minefield. Five different things can appear in</span><span>
</span><span id="line-477"></span><span class="hs-comment">-- children export lists ( T(A, B, C) ).</span><span>
</span><span id="line-478"></span><span class="hs-comment">-- 1. Record selectors</span><span>
</span><span id="line-479"></span><span class="hs-comment">-- 2. Type constructors</span><span>
</span><span id="line-480"></span><span class="hs-comment">-- 3. Data constructors</span><span>
</span><span id="line-481"></span><span class="hs-comment">-- 4. Pattern Synonyms</span><span>
</span><span id="line-482"></span><span class="hs-comment">-- 5. Pattern Synonym Selectors</span><span>
</span><span id="line-483"></span><span class="hs-comment">--</span><span>
</span><span id="line-484"></span><span class="hs-comment">-- However, things get put into weird name spaces.</span><span>
</span><span id="line-485"></span><span class="hs-comment">-- 1. Some type constructors are parsed as variables (-.-&gt;) for example.</span><span>
</span><span id="line-486"></span><span class="hs-comment">-- 2. All data constructors are parsed as type constructors</span><span>
</span><span id="line-487"></span><span class="hs-comment">-- 3. When there is ambiguity, we default type constructors to data</span><span>
</span><span id="line-488"></span><span class="hs-comment">-- constructors and require the explicit `type` keyword for type</span><span>
</span><span id="line-489"></span><span class="hs-comment">-- constructors.</span><span>
</span><span id="line-490"></span><span class="hs-comment">--</span><span>
</span><span id="line-491"></span><span class="hs-comment">-- This function first establishes the possible namespaces that an</span><span>
</span><span id="line-492"></span><span class="hs-comment">-- identifier might be in (`choosePossibleNameSpaces`).</span><span>
</span><span id="line-493"></span><span class="hs-comment">--</span><span>
</span><span id="line-494"></span><span class="hs-comment">-- Then for each namespace in turn, tries to find the correct identifier</span><span>
</span><span id="line-495"></span><span class="hs-comment">-- there returning the first positive result or the first terminating</span><span>
</span><span id="line-496"></span><span class="hs-comment">-- error.</span><span>
</span><span id="line-497"></span><span class="hs-comment">--</span><span>
</span><span id="line-498"></span><span>
</span><span id="line-499"></span><span>
</span><span id="line-500"></span><span>
</span><span id="line-501"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#lookupChildrenExport"><span class="hs-identifier hs-type">lookupChildrenExport</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIEWrappedName"><span class="hs-identifier hs-type">LIEWrappedName</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-502"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIEWrappedName"><span class="hs-identifier hs-type">LIEWrappedName</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-503"></span><span id="lookupChildrenExport"><span class="annot"><span class="annottext">lookupChildrenExport :: Name
-&gt; [Located (IEWrappedName RdrName)]
-&gt; RnM
     ([GenLocated SrcSpan (IEWrappedName Name)], [Located FieldLabel])
</span><a href="GHC.Tc.Gen.Export.html#lookupChildrenExport"><span class="hs-identifier hs-var hs-var">lookupChildrenExport</span></a></span></span><span> </span><span id="local-6989586621681161917"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161917"><span class="hs-identifier hs-var">spec_parent</span></a></span></span><span> </span><span id="local-6989586621681161916"><span class="annot"><span class="annottext">[Located (IEWrappedName RdrName)]
</span><a href="#local-6989586621681161916"><span class="hs-identifier hs-var">rdr_items</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-504"></span><span>  </span><span class="hs-keyword">do</span><span>
</span><span id="line-505"></span><span>    </span><span id="local-6989586621681161915"><span class="annot"><span class="annottext">[Either
   (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)]
</span><a href="#local-6989586621681161915"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located (IEWrappedName RdrName)
 -&gt; TcRn
      (Either
         (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)))
-&gt; [Located (IEWrappedName RdrName)]
-&gt; TcRn
     [Either
        (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)]
forall a b. (a -&gt; TcRn b) -&gt; [a] -&gt; TcRn [b]
</span><a href="GHC.Tc.Utils.Monad.html#mapAndReportM"><span class="hs-identifier hs-var">mapAndReportM</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
-&gt; TcRn
     (Either
        (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel))
</span><a href="#local-6989586621681161913"><span class="hs-identifier hs-var">doOne</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (IEWrappedName RdrName)]
</span><a href="#local-6989586621681161916"><span class="hs-identifier hs-var">rdr_items</span></a></span><span>
</span><span id="line-506"></span><span>    </span><span class="annot"><span class="annottext">([GenLocated SrcSpan (IEWrappedName Name)], [Located FieldLabel])
-&gt; RnM
     ([GenLocated SrcSpan (IEWrappedName Name)], [Located FieldLabel])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(([GenLocated SrcSpan (IEWrappedName Name)], [Located FieldLabel])
 -&gt; RnM
      ([GenLocated SrcSpan (IEWrappedName Name)], [Located FieldLabel]))
-&gt; ([GenLocated SrcSpan (IEWrappedName Name)],
    [Located FieldLabel])
-&gt; RnM
     ([GenLocated SrcSpan (IEWrappedName Name)], [Located FieldLabel])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Either
   (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)]
-&gt; ([GenLocated SrcSpan (IEWrappedName Name)],
    [Located FieldLabel])
forall a b. [Either a b] -&gt; ([a], [b])
</span><a href="../../base/src/Data.Either.html#partitionEithers"><span class="hs-identifier hs-var">partitionEithers</span></a></span><span> </span><span class="annot"><span class="annottext">[Either
   (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)]
</span><a href="#local-6989586621681161915"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-507"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-508"></span><span>        </span><span class="hs-comment">-- Pick out the possible namespaces in order of priority</span><span>
</span><span id="line-509"></span><span>        </span><span class="hs-comment">-- This is a consequence of how the parser parses all</span><span>
</span><span id="line-510"></span><span>        </span><span class="hs-comment">-- data constructors as type constructors.</span><span>
</span><span id="line-511"></span><span>        </span><span class="annot"><a href="#local-6989586621681161912"><span class="hs-identifier hs-type">choosePossibleNamespaces</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#NameSpace"><span class="hs-identifier hs-type">NameSpace</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#NameSpace"><span class="hs-identifier hs-type">NameSpace</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-512"></span><span>        </span><span id="local-6989586621681161912"><span class="annot"><span class="annottext">choosePossibleNamespaces :: NameSpace -&gt; [NameSpace]
</span><a href="#local-6989586621681161912"><span class="hs-identifier hs-var hs-var">choosePossibleNamespaces</span></a></span></span><span> </span><span id="local-6989586621681161911"><span class="annot"><span class="annottext">NameSpace
</span><a href="#local-6989586621681161911"><span class="hs-identifier hs-var">ns</span></a></span></span><span>
</span><span id="line-513"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="#local-6989586621681161911"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; NameSpace -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#varName"><span class="hs-identifier hs-var">varName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#varName"><span class="hs-identifier hs-var">varName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#tcName"><span class="hs-identifier hs-var">tcName</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-514"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="#local-6989586621681161911"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; NameSpace -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#tcName"><span class="hs-identifier hs-var">tcName</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#dataName"><span class="hs-identifier hs-var">dataName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#tcName"><span class="hs-identifier hs-var">tcName</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-515"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">NameSpace
</span><a href="#local-6989586621681161911"><span class="hs-identifier hs-var">ns</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-516"></span><span>        </span><span class="hs-comment">-- Process an individual child</span><span>
</span><span id="line-517"></span><span>        </span><span class="annot"><a href="#local-6989586621681161913"><span class="hs-identifier hs-type">doOne</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIEWrappedName"><span class="hs-identifier hs-type">LIEWrappedName</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span>
</span><span id="line-518"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#LIEWrappedName"><span class="hs-identifier hs-type">LIEWrappedName</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-519"></span><span>        </span><span id="local-6989586621681161913"><span class="annot"><span class="annottext">doOne :: Located (IEWrappedName RdrName)
-&gt; TcRn
     (Either
        (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel))
</span><a href="#local-6989586621681161913"><span class="hs-identifier hs-var hs-var">doOne</span></a></span></span><span> </span><span id="local-6989586621681161908"><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
</span><a href="#local-6989586621681161908"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-520"></span><span>
</span><span id="line-521"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681161907"><span class="annot"><span class="annottext">bareName :: RdrName
</span><a href="#local-6989586621681161907"><span class="hs-identifier hs-var hs-var">bareName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IEWrappedName RdrName -&gt; RdrName
forall name. IEWrappedName name -&gt; name
</span><a href="GHC.Hs.ImpExp.html#ieWrappedName"><span class="hs-identifier hs-var">ieWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">(IEWrappedName RdrName -&gt; RdrName)
-&gt; (Located (IEWrappedName RdrName) -&gt; IEWrappedName RdrName)
-&gt; Located (IEWrappedName RdrName)
-&gt; RdrName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName) -&gt; IEWrappedName RdrName
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
</span><a href="#local-6989586621681161908"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-522"></span><span>              </span><span id="local-6989586621681161906"><span class="annot"><span class="annottext">lkup :: NameSpace -&gt; RnM ChildLookupResult
</span><a href="#local-6989586621681161906"><span class="hs-identifier hs-var hs-var">lkup</span></a></span></span><span> </span><span id="local-6989586621681161905"><span class="annot"><span class="annottext">NameSpace
</span><a href="#local-6989586621681161905"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Name -&gt; RdrName -&gt; RnM ChildLookupResult
</span><a href="GHC.Rename.Env.html#lookupSubBndrOcc_helper"><span class="hs-identifier hs-var">lookupSubBndrOcc_helper</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-523"></span><span>                        </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161917"><span class="hs-identifier hs-var">spec_parent</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; NameSpace -&gt; RdrName
</span><a href="GHC.Parser.PostProcess.html#setRdrNameSpace"><span class="hs-identifier hs-var">setRdrNameSpace</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681161907"><span class="hs-identifier hs-var">bareName</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="#local-6989586621681161905"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-524"></span><span>
</span><span id="line-525"></span><span>          </span><span id="local-6989586621681161903"><span class="annot"><span class="annottext">ChildLookupResult
</span><a href="#local-6989586621681161903"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span>  </span><span class="annot"><span class="annottext">[RnM ChildLookupResult] -&gt; RnM ChildLookupResult
</span><a href="GHC.Rename.Env.html#combineChildLookupResult"><span class="hs-identifier hs-var">combineChildLookupResult</span></a></span><span> </span><span class="annot"><span class="annottext">([RnM ChildLookupResult] -&gt; RnM ChildLookupResult)
-&gt; [RnM ChildLookupResult] -&gt; RnM ChildLookupResult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(NameSpace -&gt; RnM ChildLookupResult)
-&gt; [NameSpace] -&gt; [RnM ChildLookupResult]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; RnM ChildLookupResult
</span><a href="#local-6989586621681161906"><span class="hs-identifier hs-var">lkup</span></a></span><span> </span><span class="annot"><span class="annottext">([NameSpace] -&gt; [RnM ChildLookupResult])
-&gt; [NameSpace] -&gt; [RnM ChildLookupResult]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-526"></span><span>                   </span><span class="annot"><span class="annottext">NameSpace -&gt; [NameSpace]
</span><a href="#local-6989586621681161912"><span class="hs-identifier hs-var">choosePossibleNamespaces</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; NameSpace
</span><a href="GHC.Types.Name.Reader.html#rdrNameSpace"><span class="hs-identifier hs-var">rdrNameSpace</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681161907"><span class="hs-identifier hs-var">bareName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-527"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lookupChildrenExport&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ChildLookupResult -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ChildLookupResult
</span><a href="#local-6989586621681161903"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-528"></span><span>          </span><span class="hs-comment">-- Default to data constructors for slightly better error</span><span>
</span><span id="line-529"></span><span>          </span><span class="hs-comment">-- messages</span><span>
</span><span id="line-530"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681161900"><span class="hs-identifier hs-type">unboundName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span>
</span><span id="line-531"></span><span>              </span><span id="local-6989586621681161900"><span class="annot"><span class="annottext">unboundName :: RdrName
</span><a href="#local-6989586621681161900"><span class="hs-identifier hs-var hs-var">unboundName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; NameSpace
</span><a href="GHC.Types.Name.Reader.html#rdrNameSpace"><span class="hs-identifier hs-var">rdrNameSpace</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681161907"><span class="hs-identifier hs-var">bareName</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; NameSpace -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#varName"><span class="hs-identifier hs-var">varName</span></a></span><span>
</span><span id="line-532"></span><span>                                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681161907"><span class="hs-identifier hs-var">bareName</span></a></span><span>
</span><span id="line-533"></span><span>                                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; NameSpace -&gt; RdrName
</span><a href="GHC.Parser.PostProcess.html#setRdrNameSpace"><span class="hs-identifier hs-var">setRdrNameSpace</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681161907"><span class="hs-identifier hs-var">bareName</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#dataName"><span class="hs-identifier hs-var">dataName</span></a></span><span>
</span><span id="line-534"></span><span>
</span><span id="line-535"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ChildLookupResult
</span><a href="#local-6989586621681161903"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-536"></span><span>            </span><span class="annot"><span class="annottext">ChildLookupResult
</span><a href="GHC.Rename.Env.html#NameNotFound"><span class="hs-identifier hs-var">NameNotFound</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681161898"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161898"><span class="hs-identifier hs-var">ub</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Unbound.html#reportUnboundName"><span class="hs-identifier hs-var">reportUnboundName</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681161900"><span class="hs-identifier hs-var">unboundName</span></a></span><span>
</span><span id="line-537"></span><span>                               </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681161897"><span class="annot"><span class="annottext">l :: SrcSpan
</span><a href="#local-6989586621681161897"><span class="hs-identifier hs-var hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName) -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
</span><a href="#local-6989586621681161908"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-538"></span><span>                               </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Either
  (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)
-&gt; TcRn
     (Either
        (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (IEWrappedName Name)
-&gt; Either
     (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; IEWrappedName Name -&gt; GenLocated SrcSpan (IEWrappedName Name)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681161897"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name -&gt; IEWrappedName Name
forall name. Located name -&gt; IEWrappedName name
</span><a href="GHC.Hs.ImpExp.html#IEName"><span class="hs-identifier hs-var">IEName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681161897"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161898"><span class="hs-identifier hs-var">ub</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">}</span><span>
</span><span id="line-539"></span><span>            </span><span class="annot"><a href="GHC.Rename.Env.html#FoundFL"><span class="hs-identifier hs-type">FoundFL</span></a></span><span> </span><span id="local-6989586621681161895"><span class="annot"><span class="annottext">FieldLabel
</span><a href="#local-6989586621681161895"><span class="hs-identifier hs-var">fls</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either
  (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)
-&gt; TcRn
     (Either
        (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either
   (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)
 -&gt; TcRn
      (Either
         (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)))
-&gt; Either
     (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)
-&gt; TcRn
     (Either
        (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Located FieldLabel
-&gt; Either
     (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; FieldLabel -&gt; Located FieldLabel
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName) -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
</span><a href="#local-6989586621681161908"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FieldLabel
</span><a href="#local-6989586621681161895"><span class="hs-identifier hs-var">fls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-540"></span><span>            </span><span class="annot"><a href="GHC.Rename.Env.html#FoundName"><span class="hs-identifier hs-type">FoundName</span></a></span><span> </span><span id="local-6989586621681161893"><span class="annot"><span class="annottext">Parent
</span><a href="#local-6989586621681161893"><span class="hs-identifier hs-var">par</span></a></span></span><span> </span><span id="local-6989586621681161892"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161892"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Parent -&gt; Name -&gt; TcRn ()
</span><a href="GHC.Tc.Gen.Export.html#checkPatSynParent"><span class="hs-identifier hs-var">checkPatSynParent</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161917"><span class="hs-identifier hs-var">spec_parent</span></a></span><span> </span><span class="annot"><span class="annottext">Parent
</span><a href="#local-6989586621681161893"><span class="hs-identifier hs-var">par</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161892"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-541"></span><span>                                     </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Either
  (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)
-&gt; TcRn
     (Either
        (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span>
</span><span id="line-542"></span><span>                                       </span><span class="annot"><span class="annottext">(Either
   (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)
 -&gt; TcRn
      (Either
         (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)))
-&gt; Either
     (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)
-&gt; TcRn
     (Either
        (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (IEWrappedName Name)
-&gt; Either
     (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
-&gt; Name -&gt; GenLocated SrcSpan (IEWrappedName Name)
forall name1 name2.
LIEWrappedName name1 -&gt; name2 -&gt; LIEWrappedName name2
</span><a href="GHC.Hs.ImpExp.html#replaceLWrappedName"><span class="hs-identifier hs-var">replaceLWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
</span><a href="#local-6989586621681161908"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161892"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-543"></span><span>            </span><span class="annot"><a href="GHC.Rename.Env.html#IncorrectParent"><span class="hs-identifier hs-type">IncorrectParent</span></a></span><span> </span><span id="local-6989586621681161889"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161889"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621681161888"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161888"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621681161887"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161887"><span class="hs-identifier hs-var">td</span></a></span></span><span> </span><span id="local-6989586621681161886"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161886"><span class="hs-identifier hs-var">gs</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name
-&gt; Name
-&gt; SDoc
-&gt; [Name]
-&gt; TcRn
     (Either
        (GenLocated SrcSpan (IEWrappedName Name)) (Located FieldLabel))
forall a. Name -&gt; Name -&gt; SDoc -&gt; [Name] -&gt; TcM a
</span><a href="GHC.Tc.Gen.Export.html#failWithDcErr"><span class="hs-identifier hs-var">failWithDcErr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161889"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161888"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161887"><span class="hs-identifier hs-var">td</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161886"><span class="hs-identifier hs-var">gs</span></a></span><span>
</span><span id="line-544"></span><span>
</span><span id="line-545"></span><span>
</span><span id="line-546"></span><span class="hs-comment">-- Note: [Typing Pattern Synonym Exports]</span><span>
</span><span id="line-547"></span><span class="hs-comment">-- It proved quite a challenge to precisely specify which pattern synonyms</span><span>
</span><span id="line-548"></span><span class="hs-comment">-- should be allowed to be bundled with which type constructors.</span><span>
</span><span id="line-549"></span><span class="hs-comment">-- In the end it was decided to be quite liberal in what we allow. Below is</span><span>
</span><span id="line-550"></span><span class="hs-comment">-- how Simon described the implementation.</span><span>
</span><span id="line-551"></span><span class="hs-comment">--</span><span>
</span><span id="line-552"></span><span class="hs-comment">-- &quot;Personally I think we should Keep It Simple.  All this talk of</span><span>
</span><span id="line-553"></span><span class="hs-comment">--  satisfiability makes me shiver.  I suggest this: allow T( P ) in all</span><span>
</span><span id="line-554"></span><span class="hs-comment">--   situations except where `P`'s type is ''visibly incompatible'' with</span><span>
</span><span id="line-555"></span><span class="hs-comment">--   `T`.</span><span>
</span><span id="line-556"></span><span class="hs-comment">--</span><span>
</span><span id="line-557"></span><span class="hs-comment">--    What does &quot;visibly incompatible&quot; mean?  `P` is visibly incompatible</span><span>
</span><span id="line-558"></span><span class="hs-comment">--    with</span><span>
</span><span id="line-559"></span><span class="hs-comment">--     `T` if</span><span>
</span><span id="line-560"></span><span class="hs-comment">--       * `P`'s type is of form `... -&gt; S t1 t2`</span><span>
</span><span id="line-561"></span><span class="hs-comment">--       * `S` is a data/newtype constructor distinct from `T`</span><span>
</span><span id="line-562"></span><span class="hs-comment">--</span><span>
</span><span id="line-563"></span><span class="hs-comment">--  Nothing harmful happens if we allow `P` to be exported with</span><span>
</span><span id="line-564"></span><span class="hs-comment">--  a type it can't possibly be useful for, but specifying a tighter</span><span>
</span><span id="line-565"></span><span class="hs-comment">--  relationship is very awkward as you have discovered.&quot;</span><span>
</span><span id="line-566"></span><span class="hs-comment">--</span><span>
</span><span id="line-567"></span><span class="hs-comment">-- Note that this allows *any* pattern synonym to be bundled with any</span><span>
</span><span id="line-568"></span><span class="hs-comment">-- datatype type constructor. For example, the following pattern `P` can be</span><span>
</span><span id="line-569"></span><span class="hs-comment">-- bundled with any type.</span><span>
</span><span id="line-570"></span><span class="hs-comment">--</span><span>
</span><span id="line-571"></span><span class="hs-comment">-- ```</span><span>
</span><span id="line-572"></span><span class="hs-comment">-- pattern P :: (A ~ f) =&gt; f</span><span>
</span><span id="line-573"></span><span class="hs-comment">-- ```</span><span>
</span><span id="line-574"></span><span class="hs-comment">--</span><span>
</span><span id="line-575"></span><span class="hs-comment">-- So we provide basic type checking in order to help the user out, most</span><span>
</span><span id="line-576"></span><span class="hs-comment">-- pattern synonyms are defined with definite type constructors, but don't</span><span>
</span><span id="line-577"></span><span class="hs-comment">-- actually prevent a library author completely confusing their users if</span><span>
</span><span id="line-578"></span><span class="hs-comment">-- they want to.</span><span>
</span><span id="line-579"></span><span class="hs-comment">--</span><span>
</span><span id="line-580"></span><span class="hs-comment">-- So, we check for exactly four things</span><span>
</span><span id="line-581"></span><span class="hs-comment">-- 1. The name arises from a pattern synonym definition. (Either a pattern</span><span>
</span><span id="line-582"></span><span class="hs-comment">--    synonym constructor or a pattern synonym selector)</span><span>
</span><span id="line-583"></span><span class="hs-comment">-- 2. The pattern synonym is only bundled with a datatype or newtype.</span><span>
</span><span id="line-584"></span><span class="hs-comment">-- 3. Check that the head of the result type constructor is an actual type</span><span>
</span><span id="line-585"></span><span class="hs-comment">--    constructor and not a type variable. (See above example)</span><span>
</span><span id="line-586"></span><span class="hs-comment">-- 4. Is so, check that this type constructor is the same as the parent</span><span>
</span><span id="line-587"></span><span class="hs-comment">--    type constructor.</span><span>
</span><span id="line-588"></span><span class="hs-comment">--</span><span>
</span><span id="line-589"></span><span class="hs-comment">--</span><span>
</span><span id="line-590"></span><span class="hs-comment">-- Note: [Types of TyCon]</span><span>
</span><span id="line-591"></span><span class="hs-comment">--</span><span>
</span><span id="line-592"></span><span class="hs-comment">-- This check appears to be overlly complicated, Richard asked why it</span><span>
</span><span id="line-593"></span><span class="hs-comment">-- is not simply just `isAlgTyCon`. The answer for this is that</span><span>
</span><span id="line-594"></span><span class="hs-comment">-- a classTyCon is also an `AlgTyCon` which we explicitly want to disallow.</span><span>
</span><span id="line-595"></span><span class="hs-comment">-- (It is either a newtype or data depending on the number of methods)</span><span>
</span><span id="line-596"></span><span class="hs-comment">--</span><span>
</span><span id="line-597"></span><span>
</span><span id="line-598"></span><span class="hs-comment">-- | Given a resolved name in the children export list and a parent. Decide</span><span>
</span><span id="line-599"></span><span class="hs-comment">-- whether we are allowed to export the child with the parent.</span><span>
</span><span id="line-600"></span><span class="hs-comment">-- Invariant: gre_par == NoParent</span><span>
</span><span id="line-601"></span><span class="hs-comment">-- See note [Typing Pattern Synonym Exports]</span><span>
</span><span id="line-602"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#checkPatSynParent"><span class="hs-identifier hs-type">checkPatSynParent</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>    </span><span class="hs-comment">-- ^ Alleged parent type constructor</span><span>
</span><span id="line-603"></span><span>                             </span><span class="hs-comment">-- User wrote T( P, Q )</span><span>
</span><span id="line-604"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#Parent"><span class="hs-identifier hs-type">Parent</span></a></span><span>  </span><span class="hs-comment">-- The parent of P we discovered</span><span>
</span><span id="line-605"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>    </span><span class="hs-comment">-- ^ Either a</span><span>
</span><span id="line-606"></span><span>                             </span><span class="hs-comment">--   a) Pattern Synonym Constructor</span><span>
</span><span id="line-607"></span><span>                             </span><span class="hs-comment">--   b) A pattern synonym selector</span><span>
</span><span id="line-608"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- Fails if wrong parent</span><span>
</span><span id="line-609"></span><span id="checkPatSynParent"><span class="annot"><span class="annottext">checkPatSynParent :: Name -&gt; Parent -&gt; Name -&gt; TcRn ()
</span><a href="GHC.Tc.Gen.Export.html#checkPatSynParent"><span class="hs-identifier hs-var hs-var">checkPatSynParent</span></a></span></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#ParentIs"><span class="hs-identifier hs-type">ParentIs</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-610"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-611"></span><span>
</span><span id="line-612"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#checkPatSynParent"><span class="hs-identifier hs-var">checkPatSynParent</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#FldParent"><span class="hs-identifier hs-type">FldParent</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-613"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-614"></span><span>
</span><span id="line-615"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#checkPatSynParent"><span class="hs-identifier hs-var">checkPatSynParent</span></a></span><span> </span><span id="local-6989586621681161884"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161884"><span class="hs-identifier hs-var">parent</span></a></span></span><span> </span><span class="annot"><span class="annottext">Parent
</span><a href="GHC.Types.Name.Reader.html#NoParent"><span class="hs-identifier hs-var">NoParent</span></a></span><span> </span><span id="local-6989586621681161883"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161883"><span class="hs-identifier hs-var">mpat_syn</span></a></span></span><span>
</span><span id="line-616"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Builtin.Names.html#isUnboundName"><span class="hs-identifier hs-var">isUnboundName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161884"><span class="hs-identifier hs-var">parent</span></a></span><span> </span><span class="hs-comment">-- Avoid an error cascade</span><span>
</span><span id="line-617"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-618"></span><span>
</span><span id="line-619"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-620"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681161882"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681161882"><span class="hs-identifier hs-var">parent_ty_con</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM TyCon
</span><a href="GHC.Tc.Utils.Env.html#tcLookupTyCon"><span class="hs-identifier hs-var">tcLookupTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161884"><span class="hs-identifier hs-var">parent</span></a></span><span>
</span><span id="line-621"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681161880"><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681161880"><span class="hs-identifier hs-var">mpat_syn_thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM TyThing
</span><a href="GHC.Tc.Utils.Env.html#tcLookupGlobal"><span class="hs-identifier hs-var">tcLookupGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161883"><span class="hs-identifier hs-var">mpat_syn</span></a></span><span>
</span><span id="line-622"></span><span>
</span><span id="line-623"></span><span>        </span><span class="hs-comment">-- 1. Check that the Id was actually from a thing associated with patsyns</span><span>
</span><span id="line-624"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681161880"><span class="hs-identifier hs-var">mpat_syn_thing</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-625"></span><span>            </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AnId"><span class="hs-identifier hs-type">AnId</span></a></span><span> </span><span id="local-6989586621681161877"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681161877"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isId"><span class="hs-identifier hs-var">isId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681161877"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-626"></span><span>                   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html#RecSelId"><span class="hs-identifier hs-type">RecSelId</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sel_tycon :: IdDetails -&gt; RecSelParent
</span><a href="GHC.Types.Id.Info.html#sel_tycon"><span class="hs-identifier hs-var">sel_tycon</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html#RecSelPatSyn"><span class="hs-identifier hs-type">RecSelPatSyn</span></a></span><span> </span><span id="local-6989586621681161872"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681161872"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; IdDetails
</span><a href="GHC.Types.Var.html#idDetails"><span class="hs-identifier hs-var">idDetails</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681161877"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-627"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TyCon -&gt; PatSyn -&gt; TcRn ()
</span><a href="#local-6989586621681161870"><span class="hs-identifier hs-var">handle_pat_syn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; SDoc
</span><a href="#local-6989586621681161869"><span class="hs-identifier hs-var">selErr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681161877"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681161882"><span class="hs-identifier hs-var">parent_ty_con</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681161872"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-628"></span><span>
</span><span id="line-629"></span><span>            </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AConLike"><span class="hs-identifier hs-type">AConLike</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.ConLike.html#PatSynCon"><span class="hs-identifier hs-type">PatSynCon</span></a></span><span> </span><span id="local-6989586621681161866"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681161866"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TyCon -&gt; PatSyn -&gt; TcRn ()
</span><a href="#local-6989586621681161870"><span class="hs-identifier hs-var">handle_pat_syn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PatSyn -&gt; SDoc
</span><a href="#local-6989586621681161865"><span class="hs-identifier hs-var">psErr</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681161866"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681161882"><span class="hs-identifier hs-var">parent_ty_con</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681161866"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-630"></span><span>
</span><span id="line-631"></span><span>            </span><span class="annot"><span class="annottext">TyThing
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; SDoc -&gt; [Name] -&gt; TcRn ()
forall a. Name -&gt; Name -&gt; SDoc -&gt; [Name] -&gt; TcM a
</span><a href="GHC.Tc.Gen.Export.html#failWithDcErr"><span class="hs-identifier hs-var">failWithDcErr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161884"><span class="hs-identifier hs-var">parent</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161883"><span class="hs-identifier hs-var">mpat_syn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161883"><span class="hs-identifier hs-var">mpat_syn</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-632"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-633"></span><span>    </span><span id="local-6989586621681161865"><span class="annot"><span class="annottext">psErr :: PatSyn -&gt; SDoc
</span><a href="#local-6989586621681161865"><span class="hs-identifier hs-var hs-var">psErr</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; PatSyn -&gt; SDoc
forall o. Outputable o =&gt; String -&gt; o -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#exportErrCtxt"><span class="hs-identifier hs-var">exportErrCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;pattern synonym&quot;</span></span><span>
</span><span id="line-634"></span><span>    </span><span id="local-6989586621681161869"><span class="annot"><span class="annottext">selErr :: Id -&gt; SDoc
</span><a href="#local-6989586621681161869"><span class="hs-identifier hs-var hs-var">selErr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Id -&gt; SDoc
forall o. Outputable o =&gt; String -&gt; o -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#exportErrCtxt"><span class="hs-identifier hs-var">exportErrCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;pattern synonym record selector&quot;</span></span><span>
</span><span id="line-635"></span><span>
</span><span id="line-636"></span><span>    </span><span class="annot"><a href="#local-6989586621681161859"><span class="hs-identifier hs-type">assocClassErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-637"></span><span>    </span><span id="local-6989586621681161859"><span class="annot"><span class="annottext">assocClassErr :: SDoc
</span><a href="#local-6989586621681161859"><span class="hs-identifier hs-var hs-var">assocClassErr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Pattern synonyms can be bundled only with datatypes.&quot;</span></span><span>
</span><span id="line-638"></span><span>
</span><span id="line-639"></span><span>    </span><span class="annot"><a href="#local-6989586621681161870"><span class="hs-identifier hs-type">handle_pat_syn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-640"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>      </span><span class="hs-comment">-- ^ Parent TyCon</span><span>
</span><span id="line-641"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span>     </span><span class="hs-comment">-- ^ Corresponding bundled PatSyn</span><span>
</span><span id="line-642"></span><span>                                 </span><span class="hs-comment">--   and pretty printed origin</span><span>
</span><span id="line-643"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-644"></span><span>    </span><span id="local-6989586621681161870"><span class="annot"><span class="annottext">handle_pat_syn :: SDoc -&gt; TyCon -&gt; PatSyn -&gt; TcRn ()
</span><a href="#local-6989586621681161870"><span class="hs-identifier hs-var hs-var">handle_pat_syn</span></a></span></span><span> </span><span id="local-6989586621681161857"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161857"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span id="local-6989586621681161856"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681161856"><span class="hs-identifier hs-var">ty_con</span></a></span></span><span> </span><span id="local-6989586621681161855"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681161855"><span class="hs-identifier hs-var">pat_syn</span></a></span></span><span>
</span><span id="line-645"></span><span>
</span><span id="line-646"></span><span>      </span><span class="hs-comment">-- 2. See note [Types of TyCon]</span><span>
</span><span id="line-647"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; Bool -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTyConWithSrcDataCons"><span class="hs-identifier hs-var">isTyConWithSrcDataCons</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681161856"><span class="hs-identifier hs-var">ty_con</span></a></span><span>
</span><span id="line-648"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn () -&gt; TcRn ()
forall a. SDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161857"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn ()
forall a. SDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161859"><span class="hs-identifier hs-var">assocClassErr</span></a></span><span>
</span><span id="line-649"></span><span>
</span><span id="line-650"></span><span>      </span><span class="hs-comment">-- 3. Is the head a type variable?</span><span>
</span><span id="line-651"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="#local-6989586621681161851"><span class="hs-identifier hs-var">mtycon</span></a></span><span>
</span><span id="line-652"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-653"></span><span>      </span><span class="hs-comment">-- 4. Ok. Check they are actually the same type constructor.</span><span>
</span><span id="line-654"></span><span>
</span><span id="line-655"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681161850"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681161850"><span class="hs-identifier hs-var">p_ty_con</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe TyCon
</span><a href="#local-6989586621681161851"><span class="hs-identifier hs-var">mtycon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681161850"><span class="hs-identifier hs-var">p_ty_con</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TyCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681161856"><span class="hs-identifier hs-var">ty_con</span></a></span><span>
</span><span id="line-656"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn () -&gt; TcRn ()
forall a. SDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161857"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn ()
forall a. SDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161848"><span class="hs-identifier hs-var">typeMismatchError</span></a></span><span>
</span><span id="line-657"></span><span>
</span><span id="line-658"></span><span>      </span><span class="hs-comment">-- 5. We passed!</span><span>
</span><span id="line-659"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-660"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-661"></span><span>
</span><span id="line-662"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-663"></span><span>        </span><span id="local-6989586621681161847"><span class="annot"><span class="annottext">expected_res_ty :: Type
</span><a href="#local-6989586621681161847"><span class="hs-identifier hs-var hs-var">expected_res_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConApp"><span class="hs-identifier hs-var">mkTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681161856"><span class="hs-identifier hs-var">ty_con</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; [Type]
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTys"><span class="hs-identifier hs-var">mkTyVarTys</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; [Id]
</span><a href="GHC.Core.TyCon.html#tyConTyVars"><span class="hs-identifier hs-var hs-var">tyConTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681161856"><span class="hs-identifier hs-var">ty_con</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-664"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Scaled Type]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161843"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681161843"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; ([Id], [Type], [Id], [Type], [Scaled Type], Type)
</span><a href="GHC.Core.PatSyn.html#patSynSig"><span class="hs-identifier hs-var">patSynSig</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681161855"><span class="hs-identifier hs-var">pat_syn</span></a></span><span>
</span><span id="line-665"></span><span>        </span><span id="local-6989586621681161851"><span class="annot"><span class="annottext">mtycon :: Maybe TyCon
</span><a href="#local-6989586621681161851"><span class="hs-identifier hs-var hs-var">mtycon</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyCon, [Type]) -&gt; TyCon
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">((TyCon, [Type]) -&gt; TyCon) -&gt; Maybe (TyCon, [Type]) -&gt; Maybe TyCon
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; Type -&gt; Maybe (TyCon, [Type])
Type -&gt; Maybe (TyCon, [Type])
</span><a href="GHC.Core.Type.html#tcSplitTyConApp_maybe"><span class="hs-identifier hs-var">tcSplitTyConApp_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681161843"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-666"></span><span>        </span><span class="annot"><a href="#local-6989586621681161848"><span class="hs-identifier hs-type">typeMismatchError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-667"></span><span>        </span><span id="local-6989586621681161848"><span class="annot"><span class="annottext">typeMismatchError :: SDoc
</span><a href="#local-6989586621681161848"><span class="hs-identifier hs-var hs-var">typeMismatchError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-668"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Pattern synonyms can only be bundled with matching type constructors&quot;</span></span><span>
</span><span id="line-669"></span><span>              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Couldn't match expected type of&quot;</span></span><span>
</span><span id="line-670"></span><span>              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681161847"><span class="hs-identifier hs-var">expected_res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-671"></span><span>              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;with actual type of&quot;</span></span><span>
</span><span id="line-672"></span><span>              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681161843"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-673"></span><span>
</span><span id="line-674"></span><span>
</span><span id="line-675"></span><span class="hs-comment">{-===========================================================================-}</span><span>
</span><span id="line-676"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#check_occs"><span class="hs-identifier hs-type">check_occs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportOccMap"><span class="hs-identifier hs-type">ExportOccMap</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Avail.html#AvailInfo"><span class="hs-identifier hs-type">AvailInfo</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-677"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Export.html#ExportOccMap"><span class="hs-identifier hs-type">ExportOccMap</span></a></span><span>
</span><span id="line-678"></span><span id="check_occs"><span class="annot"><span class="annottext">check_occs :: IE GhcPs -&gt; ExportOccMap -&gt; [AvailInfo] -&gt; RnM ExportOccMap
</span><a href="GHC.Tc.Gen.Export.html#check_occs"><span class="hs-identifier hs-var hs-var">check_occs</span></a></span></span><span> </span><span id="local-6989586621681161838"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161838"><span class="hs-identifier hs-var">ie</span></a></span></span><span> </span><span id="local-6989586621681161837"><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681161837"><span class="hs-identifier hs-var">occs</span></a></span></span><span> </span><span id="local-6989586621681161836"><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681161836"><span class="hs-identifier hs-var">avails</span></a></span></span><span>
</span><span id="line-679"></span><span>  </span><span class="hs-comment">-- 'names' and 'fls' are the entities specified by 'ie'</span><span>
</span><span id="line-680"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ExportOccMap -&gt; (Name, OccName) -&gt; RnM ExportOccMap)
-&gt; ExportOccMap -&gt; [(Name, OccName)] -&gt; RnM ExportOccMap
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Data.Foldable.html#foldlM"><span class="hs-identifier hs-var">foldlM</span></a></span><span> </span><span class="annot"><span class="annottext">ExportOccMap -&gt; (Name, OccName) -&gt; RnM ExportOccMap
</span><a href="#local-6989586621681161834"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681161837"><span class="hs-identifier hs-var">occs</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, OccName)]
</span><a href="#local-6989586621681161833"><span class="hs-identifier hs-var">names_with_occs</span></a></span><span>
</span><span id="line-681"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-682"></span><span>    </span><span class="hs-comment">-- Each Name specified by 'ie', paired with the OccName used to</span><span>
</span><span id="line-683"></span><span>    </span><span class="hs-comment">-- refer to it in the GlobalRdrEnv</span><span>
</span><span id="line-684"></span><span>    </span><span class="hs-comment">-- (see Note [Representing fields in AvailInfo] in GHC.Types.Avail).</span><span>
</span><span id="line-685"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-686"></span><span>    </span><span class="hs-comment">-- We check for export clashes using the selector Name, but need</span><span>
</span><span id="line-687"></span><span>    </span><span class="hs-comment">-- the field label OccName for presenting error messages.</span><span>
</span><span id="line-688"></span><span>    </span><span id="local-6989586621681161833"><span class="annot"><span class="annottext">names_with_occs :: [(Name, OccName)]
</span><a href="#local-6989586621681161833"><span class="hs-identifier hs-var hs-var">names_with_occs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[AvailInfo] -&gt; [(Name, OccName)]
</span><a href="GHC.Types.Avail.html#availsNamesWithOccs"><span class="hs-identifier hs-var">availsNamesWithOccs</span></a></span><span> </span><span class="annot"><span class="annottext">[AvailInfo]
</span><a href="#local-6989586621681161836"><span class="hs-identifier hs-var">avails</span></a></span><span>
</span><span id="line-689"></span><span>
</span><span id="line-690"></span><span>    </span><span id="local-6989586621681161834"><span class="annot"><span class="annottext">check :: ExportOccMap -&gt; (Name, OccName) -&gt; RnM ExportOccMap
</span><a href="#local-6989586621681161834"><span class="hs-identifier hs-var hs-var">check</span></a></span></span><span> </span><span id="local-6989586621681161831"><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681161831"><span class="hs-identifier hs-var">occs</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681161830"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161830"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161829"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161829"><span class="hs-identifier hs-var">occ</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-691"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExportOccMap -&gt; OccName -&gt; Maybe (Name, IE GhcPs)
forall a. OccEnv a -&gt; OccName -&gt; Maybe a
</span><a href="GHC.Types.Name.Occurrence.html#lookupOccEnv"><span class="hs-identifier hs-var">lookupOccEnv</span></a></span><span> </span><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681161831"><span class="hs-identifier hs-var">occs</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161827"><span class="hs-identifier hs-var">name_occ</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-692"></span><span>          </span><span class="annot"><span class="annottext">Maybe (Name, IE GhcPs)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ExportOccMap -&gt; RnM ExportOccMap
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExportOccMap -&gt; OccName -&gt; (Name, IE GhcPs) -&gt; ExportOccMap
forall a. OccEnv a -&gt; OccName -&gt; a -&gt; OccEnv a
</span><a href="GHC.Types.Name.Occurrence.html#extendOccEnv"><span class="hs-identifier hs-var">extendOccEnv</span></a></span><span> </span><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681161831"><span class="hs-identifier hs-var">occs</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161827"><span class="hs-identifier hs-var">name_occ</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161830"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161838"><span class="hs-identifier hs-var">ie</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-693"></span><span>
</span><span id="line-694"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681161825"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161825"><span class="hs-identifier hs-var">name'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161824"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161824"><span class="hs-identifier hs-var">ie'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-695"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161830"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161825"><span class="hs-identifier hs-var">name'</span></a></span><span>   </span><span class="hs-comment">-- Duplicate export</span><span>
</span><span id="line-696"></span><span>            </span><span class="hs-comment">-- But we don't want to warn if the same thing is exported</span><span>
</span><span id="line-697"></span><span>            </span><span class="hs-comment">-- by two different module exports. See ticket #4478.</span><span>
</span><span id="line-698"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; Bool -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#warnIfFlag"><span class="hs-identifier hs-var">warnIfFlag</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnDuplicateExports"><span class="hs-identifier hs-var">Opt_WarnDuplicateExports</span></a></span><span>
</span><span id="line-699"></span><span>                               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; IE GhcPs -&gt; IE GhcPs -&gt; Bool
</span><a href="GHC.Tc.Gen.Export.html#dupExport_ok"><span class="hs-identifier hs-var">dupExport_ok</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161830"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161838"><span class="hs-identifier hs-var">ie</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161824"><span class="hs-identifier hs-var">ie'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-700"></span><span>                               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; IE GhcPs -&gt; IE GhcPs -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#dupExportWarn"><span class="hs-identifier hs-var">dupExportWarn</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161829"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161838"><span class="hs-identifier hs-var">ie</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161824"><span class="hs-identifier hs-var">ie'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-701"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">ExportOccMap -&gt; RnM ExportOccMap
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681161831"><span class="hs-identifier hs-var">occs</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-702"></span><span>
</span><span id="line-703"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>    </span><span class="hs-comment">-- Same occ name but different names: an error</span><span>
</span><span id="line-704"></span><span>            </span><span class="hs-glyph">-&gt;</span><span>  </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681161821"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681161821"><span class="hs-identifier hs-var">global_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn GlobalRdrEnv
</span><a href="GHC.Tc.Utils.Monad.html#getGlobalRdrEnv"><span class="hs-identifier hs-var">getGlobalRdrEnv</span></a></span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-705"></span><span>                     </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrEnv
-&gt; OccName -&gt; Name -&gt; Name -&gt; IE GhcPs -&gt; IE GhcPs -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#exportClashErr"><span class="hs-identifier hs-var">exportClashErr</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681161821"><span class="hs-identifier hs-var">global_env</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161829"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161825"><span class="hs-identifier hs-var">name'</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161830"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161824"><span class="hs-identifier hs-var">ie'</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161838"><span class="hs-identifier hs-var">ie</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-706"></span><span>                     </span><span class="annot"><span class="annottext">ExportOccMap -&gt; RnM ExportOccMap
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ExportOccMap
</span><a href="#local-6989586621681161831"><span class="hs-identifier hs-var">occs</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-707"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-708"></span><span>        </span><span id="local-6989586621681161827"><span class="annot"><span class="annottext">name_occ :: OccName
</span><a href="#local-6989586621681161827"><span class="hs-identifier hs-var hs-var">name_occ</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161830"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-709"></span><span>
</span><span id="line-710"></span><span>
</span><span id="line-711"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#dupExport_ok"><span class="hs-identifier hs-type">dupExport_ok</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-712"></span><span class="hs-comment">-- The Name is exported by both IEs. Is that ok?</span><span>
</span><span id="line-713"></span><span class="hs-comment">-- &quot;No&quot;  iff the name is mentioned explicitly in both IEs</span><span>
</span><span id="line-714"></span><span class="hs-comment">--        or one of the IEs mentions the name *alone*</span><span>
</span><span id="line-715"></span><span class="hs-comment">-- &quot;Yes&quot; otherwise</span><span>
</span><span id="line-716"></span><span class="hs-comment">--</span><span>
</span><span id="line-717"></span><span class="hs-comment">-- Examples of &quot;no&quot;:  module M( f, f )</span><span>
</span><span id="line-718"></span><span class="hs-comment">--                    module M( fmap, Functor(..) )</span><span>
</span><span id="line-719"></span><span class="hs-comment">--                    module M( module Data.List, head )</span><span>
</span><span id="line-720"></span><span class="hs-comment">--</span><span>
</span><span id="line-721"></span><span class="hs-comment">-- Example of &quot;yes&quot;</span><span>
</span><span id="line-722"></span><span class="hs-comment">--    module M( module A, module B ) where</span><span>
</span><span id="line-723"></span><span class="hs-comment">--        import A( f )</span><span>
</span><span id="line-724"></span><span class="hs-comment">--        import B( f )</span><span>
</span><span id="line-725"></span><span class="hs-comment">--</span><span>
</span><span id="line-726"></span><span class="hs-comment">-- Example of &quot;yes&quot; (#2436)</span><span>
</span><span id="line-727"></span><span class="hs-comment">--    module M( C(..), T(..) ) where</span><span>
</span><span id="line-728"></span><span class="hs-comment">--         class C a where { data T a }</span><span>
</span><span id="line-729"></span><span class="hs-comment">--         instance C Int where { data T Int = TInt }</span><span>
</span><span id="line-730"></span><span class="hs-comment">--</span><span>
</span><span id="line-731"></span><span class="hs-comment">-- Example of &quot;yes&quot; (#2436)</span><span>
</span><span id="line-732"></span><span class="hs-comment">--    module Foo ( T ) where</span><span>
</span><span id="line-733"></span><span class="hs-comment">--      data family T a</span><span>
</span><span id="line-734"></span><span class="hs-comment">--    module Bar ( T(..), module Foo ) where</span><span>
</span><span id="line-735"></span><span class="hs-comment">--        import Foo</span><span>
</span><span id="line-736"></span><span class="hs-comment">--        data instance T Int = TInt</span><span>
</span><span id="line-737"></span><span>
</span><span id="line-738"></span><span id="dupExport_ok"><span class="annot"><span class="annottext">dupExport_ok :: Name -&gt; IE GhcPs -&gt; IE GhcPs -&gt; Bool
</span><a href="GHC.Tc.Gen.Export.html#dupExport_ok"><span class="hs-identifier hs-var hs-var">dupExport_ok</span></a></span></span><span> </span><span id="local-6989586621681161818"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161818"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681161817"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161817"><span class="hs-identifier hs-var">ie1</span></a></span></span><span> </span><span id="local-6989586621681161816"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161816"><span class="hs-identifier hs-var">ie2</span></a></span></span><span>
</span><span id="line-739"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span>  </span><span class="annot"><span class="annottext">IE GhcPs -&gt; Bool
forall {pass}. IE pass -&gt; Bool
</span><a href="#local-6989586621681161815"><span class="hs-identifier hs-var">single</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161817"><span class="hs-identifier hs-var">ie1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">IE GhcPs -&gt; Bool
forall {pass}. IE pass -&gt; Bool
</span><a href="#local-6989586621681161815"><span class="hs-identifier hs-var">single</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161816"><span class="hs-identifier hs-var">ie2</span></a></span><span>
</span><span id="line-740"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IE GhcPs -&gt; Bool
</span><a href="#local-6989586621681161814"><span class="hs-identifier hs-var">explicit_in</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161817"><span class="hs-identifier hs-var">ie1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">IE GhcPs -&gt; Bool
</span><a href="#local-6989586621681161814"><span class="hs-identifier hs-var">explicit_in</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161816"><span class="hs-identifier hs-var">ie2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-741"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-742"></span><span>    </span><span id="local-6989586621681161814"><span class="annot"><span class="annottext">explicit_in :: IE GhcPs -&gt; Bool
</span><a href="#local-6989586621681161814"><span class="hs-identifier hs-var hs-var">explicit_in</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEModuleContents"><span class="hs-identifier hs-type">IEModuleContents</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>                   </span><span class="hs-comment">-- module M</span><span>
</span><span id="line-743"></span><span>    </span><span class="annot"><a href="#local-6989586621681161814"><span class="hs-identifier hs-var">explicit_in</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEThingAll"><span class="hs-identifier hs-type">IEThingAll</span></a></span><span> </span><span class="annot"><span class="annottext">XIEThingAll GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681161813"><span class="annot"><span class="annottext">LIEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161813"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-744"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161818"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; OccName -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; OccName
</span><a href="GHC.Types.Name.Reader.html#rdrNameOcc"><span class="hs-identifier hs-var">rdrNameOcc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IEWrappedName RdrName -&gt; RdrName
forall name. IEWrappedName name -&gt; name
</span><a href="GHC.Hs.ImpExp.html#ieWrappedName"><span class="hs-identifier hs-var">ieWrappedName</span></a></span><span> </span><span class="annot"><span class="annottext">(IEWrappedName RdrName -&gt; RdrName)
-&gt; IEWrappedName RdrName -&gt; RdrName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName) -&gt; IEWrappedName RdrName
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IEWrappedName RdrName)
LIEWrappedName (IdP GhcPs)
</span><a href="#local-6989586621681161813"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- T(..)</span><span>
</span><span id="line-745"></span><span>    </span><span class="annot"><a href="#local-6989586621681161814"><span class="hs-identifier hs-var">explicit_in</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><span class="hs-identifier">_</span></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-746"></span><span>
</span><span id="line-747"></span><span>    </span><span id="local-6989586621681161815"><span class="annot"><span class="annottext">single :: IE pass -&gt; Bool
</span><a href="#local-6989586621681161815"><span class="hs-identifier hs-var hs-var">single</span></a></span></span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEVar"><span class="hs-identifier hs-type">IEVar</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-748"></span><span>    </span><span class="annot"><a href="#local-6989586621681161815"><span class="hs-identifier hs-var">single</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IEThingAbs"><span class="hs-identifier hs-type">IEThingAbs</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-749"></span><span>    </span><span class="annot"><a href="#local-6989586621681161815"><span class="hs-identifier hs-var">single</span></a></span><span> </span><span class="annot"><span class="annottext">IE pass
</span><span class="hs-identifier">_</span></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-750"></span><span>
</span><span id="line-751"></span><span>
</span><span id="line-752"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#dupModuleExport"><span class="hs-identifier hs-type">dupModuleExport</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-753"></span><span id="dupModuleExport"><span class="annot"><span class="annottext">dupModuleExport :: ModuleName -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#dupModuleExport"><span class="hs-identifier hs-var hs-var">dupModuleExport</span></a></span></span><span> </span><span id="local-6989586621681161811"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681161811"><span class="hs-identifier hs-var">mod</span></a></span></span><span>
</span><span id="line-754"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Duplicate&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-755"></span><span>          </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Module&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681161811"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-756"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;in export list&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-757"></span><span>
</span><span id="line-758"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#moduleNotImported"><span class="hs-identifier hs-type">moduleNotImported</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-759"></span><span id="moduleNotImported"><span class="annot"><span class="annottext">moduleNotImported :: ModuleName -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#moduleNotImported"><span class="hs-identifier hs-var hs-var">moduleNotImported</span></a></span></span><span> </span><span id="local-6989586621681161809"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681161809"><span class="hs-identifier hs-var">mod</span></a></span></span><span>
</span><span id="line-760"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The export item&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-761"></span><span>          </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;module&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681161809"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-762"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is not imported&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-763"></span><span>
</span><span id="line-764"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#nullModuleExport"><span class="hs-identifier hs-type">nullModuleExport</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-765"></span><span id="nullModuleExport"><span class="annot"><span class="annottext">nullModuleExport :: ModuleName -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#nullModuleExport"><span class="hs-identifier hs-var hs-var">nullModuleExport</span></a></span></span><span> </span><span id="local-6989586621681161808"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681161808"><span class="hs-identifier hs-var">mod</span></a></span></span><span>
</span><span id="line-766"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The export item&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-767"></span><span>          </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;module&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681161808"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-768"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;exports nothing&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-769"></span><span>
</span><span id="line-770"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#missingModuleExportWarn"><span class="hs-identifier hs-type">missingModuleExportWarn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-771"></span><span id="missingModuleExportWarn"><span class="annot"><span class="annottext">missingModuleExportWarn :: ModuleName -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#missingModuleExportWarn"><span class="hs-identifier hs-var hs-var">missingModuleExportWarn</span></a></span></span><span> </span><span id="local-6989586621681161807"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681161807"><span class="hs-identifier hs-var">mod</span></a></span></span><span>
</span><span id="line-772"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The export item&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-773"></span><span>          </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;module&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681161807"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-774"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is missing an export list&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-775"></span><span>
</span><span id="line-776"></span><span>
</span><span id="line-777"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#dodgyExportWarn"><span class="hs-identifier hs-type">dodgyExportWarn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-778"></span><span id="dodgyExportWarn"><span class="annot"><span class="annottext">dodgyExportWarn :: Name -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#dodgyExportWarn"><span class="hs-identifier hs-var hs-var">dodgyExportWarn</span></a></span></span><span> </span><span id="local-6989586621681161806"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161806"><span class="hs-identifier hs-var">item</span></a></span></span><span>
</span><span id="line-779"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Name -&gt; IE GhcRn -&gt; SDoc
forall a b. (Outputable a, Outputable b) =&gt; SDoc -&gt; a -&gt; b -&gt; SDoc
</span><a href="GHC.Rename.Names.html#dodgyMsg"><span class="hs-identifier hs-var">dodgyMsg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;export&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161806"><span class="hs-identifier hs-var">item</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdP GhcRn -&gt; IE GhcRn
forall (p :: Pass). IdP (GhcPass p) -&gt; IE (GhcPass p)
</span><a href="GHC.Rename.Names.html#dodgyMsgInsert"><span class="hs-identifier hs-var">dodgyMsgInsert</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681161806"><span class="hs-identifier hs-var">item</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-780"></span><span>
</span><span id="line-781"></span><span id="local-6989586621681162390"><span class="annot"><a href="GHC.Tc.Gen.Export.html#exportErrCtxt"><span class="hs-identifier hs-type">exportErrCtxt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681162390"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681162390"><span class="hs-identifier hs-type">o</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span><span>
</span><span id="line-782"></span><span id="exportErrCtxt"><span class="annot"><span class="annottext">exportErrCtxt :: forall o. Outputable o =&gt; String -&gt; o -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#exportErrCtxt"><span class="hs-identifier hs-var hs-var">exportErrCtxt</span></a></span></span><span> </span><span id="local-6989586621681161798"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681161798"><span class="hs-identifier hs-var">herald</span></a></span></span><span> </span><span id="local-6989586621681161797"><span class="annot"><span class="annottext">o
</span><a href="#local-6989586621681161797"><span class="hs-identifier hs-var">exp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-783"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681161798"><span class="hs-identifier hs-var">herald</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;:&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">o -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">o
</span><a href="#local-6989586621681161797"><span class="hs-identifier hs-var">exp</span></a></span><span>
</span><span id="line-784"></span><span>
</span><span id="line-785"></span><span>
</span><span id="line-786"></span><span id="local-6989586621681162414"><span id="local-6989586621681162415"><span class="annot"><a href="GHC.Tc.Gen.Export.html#addExportErrCtxt"><span class="hs-identifier hs-type">addExportErrCtxt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Extension.html#OutputableBndrId"><span class="hs-identifier hs-type">OutputableBndrId</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681162415"><span class="hs-identifier hs-type">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-787"></span><span>                 </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPass"><span class="hs-identifier hs-type">GhcPass</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681162415"><span class="hs-identifier hs-type">p</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681162414"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681162414"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-788"></span><span id="addExportErrCtxt"><span class="annot"><span class="annottext">addExportErrCtxt :: forall (p :: Pass) a.
OutputableBndrId p =&gt;
IE (GhcPass p) -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Gen.Export.html#addExportErrCtxt"><span class="hs-identifier hs-var hs-var">addExportErrCtxt</span></a></span></span><span> </span><span id="local-6989586621681161790"><span class="annot"><span class="annottext">IE (GhcPass p)
</span><a href="#local-6989586621681161790"><span class="hs-identifier hs-var">ie</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcM a -&gt; TcM a
forall a. SDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161789"><span class="hs-identifier hs-var">exportCtxt</span></a></span><span>
</span><span id="line-789"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-790"></span><span>    </span><span id="local-6989586621681161789"><span class="annot"><span class="annottext">exportCtxt :: SDoc
</span><a href="#local-6989586621681161789"><span class="hs-identifier hs-var hs-var">exportCtxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the export:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">IE (GhcPass p) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">IE (GhcPass p)
</span><a href="#local-6989586621681161790"><span class="hs-identifier hs-var">ie</span></a></span><span>
</span><span id="line-791"></span><span>
</span><span id="line-792"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#exportItemErr"><span class="hs-identifier hs-type">exportItemErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-793"></span><span id="exportItemErr"><span class="annot"><span class="annottext">exportItemErr :: IE GhcPs -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#exportItemErr"><span class="hs-identifier hs-var hs-var">exportItemErr</span></a></span></span><span> </span><span id="local-6989586621681161788"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161788"><span class="hs-identifier hs-var">export_item</span></a></span></span><span>
</span><span id="line-794"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The export item&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IE GhcPs -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161788"><span class="hs-identifier hs-var">export_item</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-795"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;attempts to export constructors or class methods that are not visible here&quot;</span></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-796"></span><span>
</span><span id="line-797"></span><span>
</span><span id="line-798"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#dupExportWarn"><span class="hs-identifier hs-type">dupExportWarn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-799"></span><span id="dupExportWarn"><span class="annot"><span class="annottext">dupExportWarn :: OccName -&gt; IE GhcPs -&gt; IE GhcPs -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#dupExportWarn"><span class="hs-identifier hs-var hs-var">dupExportWarn</span></a></span></span><span> </span><span id="local-6989586621681161786"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161786"><span class="hs-identifier hs-var">occ_name</span></a></span></span><span> </span><span id="local-6989586621681161785"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161785"><span class="hs-identifier hs-var">ie1</span></a></span></span><span> </span><span id="local-6989586621681161784"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161784"><span class="hs-identifier hs-var">ie2</span></a></span></span><span>
</span><span id="line-800"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161786"><span class="hs-identifier hs-var">occ_name</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-801"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is exported by&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IE GhcPs -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161785"><span class="hs-identifier hs-var">ie1</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-802"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;and&quot;</span></span><span class="hs-special">,</span><span>            </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IE GhcPs -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161784"><span class="hs-identifier hs-var">ie2</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-803"></span><span>
</span><span id="line-804"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#dcErrMsg"><span class="hs-identifier hs-type">dcErrMsg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-805"></span><span id="dcErrMsg"><span class="annot"><span class="annottext">dcErrMsg :: Name -&gt; String -&gt; SDoc -&gt; [SDoc] -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#dcErrMsg"><span class="hs-identifier hs-var hs-var">dcErrMsg</span></a></span></span><span> </span><span id="local-6989586621681161782"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161782"><span class="hs-identifier hs-var">ty_con</span></a></span></span><span> </span><span id="local-6989586621681161781"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681161781"><span class="hs-identifier hs-var">what_is</span></a></span></span><span> </span><span id="local-6989586621681161780"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161780"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span id="local-6989586621681161779"><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681161779"><span class="hs-identifier hs-var">parents</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-806"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The type constructor&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161782"><span class="hs-identifier hs-var">ty_con</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-807"></span><span>                </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is not the parent of the&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681161781"><span class="hs-identifier hs-var">what_is</span></a></span><span>
</span><span id="line-808"></span><span>                </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161780"><span class="hs-identifier hs-var">thing</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'.'</span></span><span>
</span><span id="line-809"></span><span>                </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="GHC.Utils.Misc.html#capitalise"><span class="hs-identifier hs-var">capitalise</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681161781"><span class="hs-identifier hs-var">what_is</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-810"></span><span>                   </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;s can only be exported with their parent type constructor.&quot;</span></span><span>
</span><span id="line-811"></span><span>                </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681161779"><span class="hs-identifier hs-var">parents</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-812"></span><span>                      </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-813"></span><span>                      </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SDoc
</span><span class="hs-identifier">_</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Parent:&quot;</span></span><span>
</span><span id="line-814"></span><span>                      </span><span class="annot"><span class="annottext">[SDoc]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Parents:&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; [SDoc] -&gt; [SDoc]
</span><a href="GHC.Utils.Outputable.html#punctuate"><span class="hs-identifier hs-var">punctuate</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc]
</span><a href="#local-6989586621681161779"><span class="hs-identifier hs-var">parents</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-815"></span><span>
</span><span id="line-816"></span><span id="local-6989586621681162397"><span class="annot"><a href="GHC.Tc.Gen.Export.html#failWithDcErr"><span class="hs-identifier hs-type">failWithDcErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681162397"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-817"></span><span id="failWithDcErr"><span class="annot"><span class="annottext">failWithDcErr :: forall a. Name -&gt; Name -&gt; SDoc -&gt; [Name] -&gt; TcM a
</span><a href="GHC.Tc.Gen.Export.html#failWithDcErr"><span class="hs-identifier hs-var hs-var">failWithDcErr</span></a></span></span><span> </span><span id="local-6989586621681161770"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161770"><span class="hs-identifier hs-var">parent</span></a></span></span><span> </span><span id="local-6989586621681161769"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161769"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span id="local-6989586621681161768"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161768"><span class="hs-identifier hs-var">thing_doc</span></a></span></span><span> </span><span id="local-6989586621681161767"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161767"><span class="hs-identifier hs-var">parents</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-818"></span><span>  </span><span id="local-6989586621681161766"><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681161766"><span class="hs-identifier hs-var">ty_thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM TyThing
</span><a href="GHC.Tc.Utils.Env.html#tcLookupGlobal"><span class="hs-identifier hs-var">tcLookupGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161769"><span class="hs-identifier hs-var">thing</span></a></span><span>
</span><span id="line-819"></span><span>  </span><span class="annot"><span class="annottext">SDoc -&gt; TcM a
forall a. SDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; TcM a) -&gt; SDoc -&gt; TcM a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; String -&gt; SDoc -&gt; [SDoc] -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#dcErrMsg"><span class="hs-identifier hs-var">dcErrMsg</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161770"><span class="hs-identifier hs-var">parent</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyThing -&gt; String
</span><a href="#local-6989586621681161765"><span class="hs-identifier hs-var">pp_category</span></a></span><span> </span><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681161766"><span class="hs-identifier hs-var">ty_thing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-820"></span><span>                        </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681161768"><span class="hs-identifier hs-var">thing_doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Name -&gt; SDoc) -&gt; [Name] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681161767"><span class="hs-identifier hs-var">parents</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-821"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-822"></span><span>    </span><span class="annot"><a href="#local-6989586621681161765"><span class="hs-identifier hs-type">pp_category</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyThing"><span class="hs-identifier hs-type">TyThing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-823"></span><span>    </span><span id="local-6989586621681161765"><span class="annot"><span class="annottext">pp_category :: TyThing -&gt; String
</span><a href="#local-6989586621681161765"><span class="hs-identifier hs-var hs-var">pp_category</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AnId"><span class="hs-identifier hs-type">AnId</span></a></span><span> </span><span id="local-6989586621681161764"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681161764"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-824"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Id.html#isRecordSelector"><span class="hs-identifier hs-var">isRecordSelector</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681161764"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;record selector&quot;</span></span><span>
</span><span id="line-825"></span><span>    </span><span class="annot"><a href="#local-6989586621681161765"><span class="hs-identifier hs-var">pp_category</span></a></span><span> </span><span id="local-6989586621681161762"><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681161762"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyThing -&gt; String
</span><a href="GHC.Core.TyCo.Rep.html#tyThingCategory"><span class="hs-identifier hs-var">tyThingCategory</span></a></span><span> </span><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681161762"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-826"></span><span>
</span><span id="line-827"></span><span>
</span><span id="line-828"></span><span class="annot"><a href="GHC.Tc.Gen.Export.html#exportClashErr"><span class="hs-identifier hs-type">exportClashErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span>
</span><span id="line-829"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-830"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.ImpExp.html#IE"><span class="hs-identifier hs-type">IE</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-831"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span>
</span><span id="line-832"></span><span id="exportClashErr"><span class="annot"><span class="annottext">exportClashErr :: GlobalRdrEnv
-&gt; OccName -&gt; Name -&gt; Name -&gt; IE GhcPs -&gt; IE GhcPs -&gt; SDoc
</span><a href="GHC.Tc.Gen.Export.html#exportClashErr"><span class="hs-identifier hs-var hs-var">exportClashErr</span></a></span></span><span> </span><span id="local-6989586621681161759"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681161759"><span class="hs-identifier hs-var">global_env</span></a></span></span><span> </span><span id="local-6989586621681161758"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161758"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681161757"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161757"><span class="hs-identifier hs-var">name1</span></a></span></span><span> </span><span id="local-6989586621681161756"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161756"><span class="hs-identifier hs-var">name2</span></a></span></span><span> </span><span id="local-6989586621681161755"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161755"><span class="hs-identifier hs-var">ie1</span></a></span></span><span> </span><span id="local-6989586621681161754"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161754"><span class="hs-identifier hs-var">ie2</span></a></span></span><span>
</span><span id="line-833"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Conflicting exports for&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161758"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span>
</span><span id="line-834"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IE GhcPs -&gt; Name -&gt; SDoc
</span><a href="#local-6989586621681161752"><span class="hs-identifier hs-var">ppr_export</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161751"><span class="hs-identifier hs-var">ie1'</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161750"><span class="hs-identifier hs-var">name1'</span></a></span><span>
</span><span id="line-835"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IE GhcPs -&gt; Name -&gt; SDoc
</span><a href="#local-6989586621681161752"><span class="hs-identifier hs-var">ppr_export</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161749"><span class="hs-identifier hs-var">ie2'</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161748"><span class="hs-identifier hs-var">name2'</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-836"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-837"></span><span>    </span><span id="local-6989586621681161752"><span class="annot"><span class="annottext">ppr_export :: IE GhcPs -&gt; Name -&gt; SDoc
</span><a href="#local-6989586621681161752"><span class="hs-identifier hs-var hs-var">ppr_export</span></a></span></span><span> </span><span id="local-6989586621681161747"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161747"><span class="hs-identifier hs-var">ie</span></a></span></span><span> </span><span id="local-6989586621681161746"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161746"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IE GhcPs -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161747"><span class="hs-identifier hs-var">ie</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;exports&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-838"></span><span>                                       </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
</span><a href="#local-6989586621681161743"><span class="hs-identifier hs-var">ppr_name</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161746"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-839"></span><span>                                    </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; SDoc
</span><a href="GHC.Types.Name.Reader.html#pprNameProvenance"><span class="hs-identifier hs-var">pprNameProvenance</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; GlobalRdrElt
</span><a href="#local-6989586621681161741"><span class="hs-identifier hs-var">get_gre</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161746"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-840"></span><span>
</span><span id="line-841"></span><span>    </span><span class="hs-comment">-- DuplicateRecordFields means that nameOccName might be a mangled</span><span>
</span><span id="line-842"></span><span>    </span><span class="hs-comment">-- $sel-prefixed thing, in which case show the correct OccName alone</span><span>
</span><span id="line-843"></span><span>    </span><span id="local-6989586621681161743"><span class="annot"><span class="annottext">ppr_name :: Name -&gt; SDoc
</span><a href="#local-6989586621681161743"><span class="hs-identifier hs-var hs-var">ppr_name</span></a></span></span><span> </span><span id="local-6989586621681161740"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161740"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-844"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161740"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; OccName -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161758"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161740"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-845"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161758"><span class="hs-identifier hs-var">occ</span></a></span><span>
</span><span id="line-846"></span><span>
</span><span id="line-847"></span><span>    </span><span class="hs-comment">-- get_gre finds a GRE for the Name, so that we can show its provenance</span><span>
</span><span id="line-848"></span><span>    </span><span id="local-6989586621681161741"><span class="annot"><span class="annottext">get_gre :: Name -&gt; GlobalRdrElt
</span><a href="#local-6989586621681161741"><span class="hs-identifier hs-var hs-var">get_gre</span></a></span></span><span> </span><span id="local-6989586621681161739"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161739"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-849"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Maybe GlobalRdrElt -&gt; GlobalRdrElt
forall a. a -&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier hs-var">fromMaybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; GlobalRdrElt
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;exportClashErr&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161739"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-850"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; Name -&gt; OccName -&gt; Maybe GlobalRdrElt
</span><a href="GHC.Types.Name.Reader.html#lookupGRE_Name_OccName"><span class="hs-identifier hs-var">lookupGRE_Name_OccName</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681161759"><span class="hs-identifier hs-var">global_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161739"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681161758"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-851"></span><span>    </span><span id="local-6989586621681161735"><span class="annot"><span class="annottext">get_loc :: Name -&gt; SrcSpan
</span><a href="#local-6989586621681161735"><span class="hs-identifier hs-var hs-var">get_loc</span></a></span></span><span> </span><span id="local-6989586621681161734"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161734"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; SrcSpan
</span><a href="GHC.Types.Name.Reader.html#greSrcSpan"><span class="hs-identifier hs-var">greSrcSpan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; GlobalRdrElt
</span><a href="#local-6989586621681161741"><span class="hs-identifier hs-var">get_gre</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161734"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-852"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681161750"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161750"><span class="hs-identifier hs-var">name1'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161751"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161751"><span class="hs-identifier hs-var">ie1'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161748"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161748"><span class="hs-identifier hs-var">name2'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681161749"><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161749"><span class="hs-identifier hs-var">ie2'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-853"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcSpan -&gt; Ordering
</span><a href="GHC.Types.SrcLoc.html#leftmost_smallest"><span class="hs-identifier hs-var">SrcLoc.leftmost_smallest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="#local-6989586621681161735"><span class="hs-identifier hs-var">get_loc</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161757"><span class="hs-identifier hs-var">name1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="#local-6989586621681161735"><span class="hs-identifier hs-var">get_loc</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161756"><span class="hs-identifier hs-var">name2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-854"></span><span>        </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">LT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161757"><span class="hs-identifier hs-var">name1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161755"><span class="hs-identifier hs-var">ie1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161756"><span class="hs-identifier hs-var">name2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161754"><span class="hs-identifier hs-var">ie2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-855"></span><span>        </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">GT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161756"><span class="hs-identifier hs-var">name2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161754"><span class="hs-identifier hs-var">ie2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681161757"><span class="hs-identifier hs-var">name1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IE GhcPs
</span><a href="#local-6989586621681161755"><span class="hs-identifier hs-var">ie1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-856"></span><span>        </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">EQ</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; (Name, IE GhcPs, Name, IE GhcPs)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;exportClashErr: clashing exports have idential location&quot;</span></span><span>
</span><span id="line-857"></span></pre></body></html>